Part Number Hot Search : 
3B503 STM6930 STA51 ST100 AN7140 PCI954 MP151 SK301
Product Description
Full Text Search
 

To Download ST10F280-Q3TR Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  1/186 st10f280 march 2003 n high performance cpu with dsp functions - 16-bit cpu with 4-stage pipeline. - 50ns instruction cycle time at 40mhz cpu clock. - multiply/accumulate unit (mac) 16 x 16-bit multiplication, 40-bit accumulator - repeat unit. - enhanced boolean bit manipulation facilities. - additional instructions to support hll and operating systems. - single-cycle context switching support. n memory organization - 512k byte on-chip flash memory single voltage with erase/program controller. - 100k erasing/programming cycles. - 20 year data retention time - up to 16m byte linear address space for code and data (5m byte with can). - 2k byte on-chip internal ram (iram). - 16k byte extension ram (xram). n fast and flexible bus - programmable external bus characteris- tics for different address ranges. - 8-bit or 16-bit external data bus. - multiplexed or demultiplexed external address/data buses. - five programmable chip-select signals. - hold-acknowledge bus arbitration support. n interrupt - 8-channel peripheral event controller for single cycle, interrupt driven data transfer. - 16-priority-level interrupt system with 56 sources, sample-rate down to 25ns. n two multi-functional general purpose timer units with 5 timers. n two 16-channel capture/compare units n a/d converter - 2x16-channel 10-bit. - 4.85 m s conversion time - one timer for adc channel injection n 8-channel pwm unit n serial channels - synchronous/async serial channel - high-speed synchronous channel. n fail-safe protection - programmable watchdog timer. - oscillator watchdog. n two can 2.0b interfaces operating on one or two can busses (30 or 2x15 message objects) n on-chip bootstrap loader n clock generation - on-chip pll. - direct or prescaled clock input. n up to 143 general purpose i/o lines - individually programmable as input, out- put or special function. - programmable threshold (hysteresis). n idle and power down modes n maximum cpu frequency 40mhz n package pbga 208 balls (23mm x 23mm x 1.96 mm - pitch 1.27mm). n single voltage supply: 5v 10% (embedded regulator for 3.3 v core supply). n temperature range: -40 +125 c pbga208 (23 x 23 x 1.96 - pitch 1.27 mm) (plastic bold grid array) order code: st10f280-jt3 p4.7 can2_txd p4.6 can1_txd p4.5 can1_rxd p4.4 can2_rxd por t 0 por t 1 po rt 4 por t 6 po rt 5 por t 3 po rt 2 gpt1 gpt2 asc usart brg cpu-core and mac unit internal ram watchdog interrupt controller 8 32 16 pec 16 16 can1 port 7 port 8 external bus 10-bit adc brg ssc pwm capcom2 capcom1 16 oscillator controller 16 16 512k byte and pll flash memory xtal1 xtal2 2k byte 15 8 8 8 16 3.3v voltage regulator 16k byte xram can2 xport9 16 xpwm 4 xtimer p7.7 trigger for adc 16 xport10 16 16 channel injection xadcinj external connexion 16-bit mcu with mac unit, 512k byte flash memory and 18k byte ram product preview this is advance information on a new product now in development or undergoing evaluation. details are subject to change without notice.
st10f280 2/186 table of contents 1 - introduction ........................................................................................................ 6 2 - ball data ............................................................................................................... 7 3 - functional description ................................................................................... 17 4 - memory organization ....................................................................................... 18 5 - internal flash memory ................................................................................... 21 5.1 - overview ................................................................................................................ 2 1 5.2 - operational overview ...................................................................................... 21 5.3 - architectural description ............................................................................ 23 5.3.1 - read mode .............................................................................................................. ... 23 5.3.2 - command mode ......................................................................................................... 23 5.3.3 - flash status register ................................................................................................. 2 3 5.3.4 - flash protection register ........................................................................................... 25 5.3.5 - instructions description .............................................................................................. 2 5 5.3.6 - reset processing and initial state .............................................................................. 29 5.4 - flash memory configuration ........................................................................ 29 5.5 - application examples ....................................................................................... 29 5.5.1 - handling of flash addresses ...................................................................................... 29 5.5.2 - basic flash access control ........................................................................................ 30 5.5.3 - programming examples ............................................................................................. 31 5.6 - bootstrap loader ............................................................................................ 34 5.6.1 - entering the bootstrap loader .................................................................................... 34 5.6.2 - memory configuration after reset ............................................................................. 35 5.6.3 - loading the startup code ........................................................................................... 36 5.6.4 - exiting bootstrap loader mode .................................................................................. 36 5.6.5 - choosing the baud rate for the bsl ......................................................................... 37 6 - central processing unit (cpu) ..................................................................... 38 6.1 - multiplier-accumulator unit (mac) ............................................................. 39 6.1.1 - features ............................................................................................................... ...... 40 6.1.1.1 - enhanced addressing capabilities .............................................................................. 40 6.1.1.2 - multiply-accumulate unit ............................................................................................. 40 6.1.1.3 - program control ....................................................................................................... ... 40 6.2 - instruction set summary ................................................................................ 41 6.3 - mac coprocessor specific instructions ................................................. 42 7 - external bus controller .............................................................................. 46 7.1 - programmable chip select timing control ............................................ 46 7.2 - ready programmable polarity ..................................................................... 47 8 - interrupt system ............................................................................................... 49 8.1 - external interrupts ......................................................................................... 49
st10f280 3/186 8.2 - interrupt registers and vectors location list .................................. 50 8.3 - interrupt control registers ....................................................................... 52 8.4 - exception and error traps list ................................................................... 53 9 - capture/compare (capcom) units ................................................................ 54 10 - general purpose timer unit .......................................................................... 57 10.1 - gpt1 .................................................................................................................... ...... 57 10.2 - gpt2 .................................................................................................................... ...... 58 11 - pwm module .......................................................................................................... 60 11.1 - standard pwm module ...................................................................................... 60 11.2 - new pwm module : xpwm ................................................................................... 61 11.2.1 - operating modes ....................................................................................................... .62 11.2.1.1 - mode 0: standard pwm generation (edge aligned pwm) ......................................... 62 11.2.1.2 - mode 1: symmetrical pwm generation (center aligned pwm) ................................. 63 11.2.1.3 - burst mode ......................................................................................................... ....... 64 11.2.1.4 - single shot mode ................................................................................................... ... 65 11.2.2 - xpwm module registers ........................................................................................... 66 11.2.3 - interrupt request generation ..................................................................................... 68 11.2.4 - xpwm output signals ................................................................................................ 68 11.2.5 - xpolar register (polarity of the xpwm channel) .................................................... 69 12 - parallel ports ................................................................................................... 70 12.1 - introduction ........................................................................................................ 72 12.1.1 - open drain mode ....................................................................................................... 72 12.1.2 - input threshold control ............................................................................................ 7 3 12.1.3 - output driver control ............................................................................................... .73 12.1.4 - alternate port functions ............................................................................................. 7 5 12.2 - port0 ................................................................................................................... ..... 76 12.2.1 - alternate functions of port0 .................................................................................... 77 12.3 - port1 ................................................................................................................... ..... 79 12.3.1 - alternate functions of port1 .................................................................................... 79 12.4 - port 2 .................................................................................................................. ..... 80 12.4.1 - alternate functions of port 2 ..................................................................................... 81 12.5 - port 3 .................................................................................................................. ..... 84 12.5.1 - alternate functions of port 3 ...................................................................................... 85 12.6 - port 4 .................................................................................................................. ..... 87 12.6.1 - alternate functions of port 4 ...................................................................................... 88 12.7 - port 5 .................................................................................................................. ..... 92 12.7.1 - port 5 schmitt trigger analog inputs .......................................................................... 93 12.8 - port 6 .................................................................................................................. ..... 93 12.8.1 - alternate functions of port 6 ...................................................................................... 94 12.9 - port 7 .................................................................................................................. ..... 95 12.9.1 - alternate functions of port 7 ...................................................................................... 96
st10f280 4/186 12.10 - port 8 ................................................................................................................. ...... 99 12.10.1 - alternate functions of port 8 ...................................................................................... 99 12.11 - xport 9 ................................................................................................................ .... 101 12.12 - xport 10 ............................................................................................................... ... 103 12.12.1 - alternate functions of xport 10 .................................................................................. 103 12.12.2 - new disturb protection on analog inputs ................................................................... 104 13 - a/d converter ...................................................................................................... 105 13.1 - a/d converter module ...................................................................................... 105 13.2 - multiplexage of two blocks of 16 analog inputs ................................ 106 13.3 - xtimer peripheral (trigger for adc channel injection) ................... 107 13.3.1 - main features ......................................................................................................... .... 107 13.3.2 - register description .................................................................................................. .108 13.3.2.1 - tcr : timer control register ...................................................................................... 10 8 13.3.2.2 - xtsvr :timer start value register ............................................................................ 109 13.3.2.3 - xtevr : timer end value register ............................................................................ 109 13.3.2.4 - xtcvr : timer current value register....................................................................... 109 13.3.2.5 - registers mapping.................................................................................................... ... 109 13.3.3 - block diagram ........................................................................................................ ... 110 13.3.3.1 - clocks............................................................................................................... ........... 110 13.3.3.2 - registers ............................................................................................................ ......... 110 13.3.3.3 - timer output (xadcinj).............................................................................................. 111 14 - serial channels ................................................................................................. 112 14.1 - asynchronous / synchronous serial interface (asco) .................... 112 14.1.1 - asco in asynchronous mode .................................................................................... 112 14.1.2 - asco in synchronous mode ...................................................................................... 114 14.2 - high speed synchronous serial channel (ssc) ..................................... 116 15 - can modules ......................................................................................................... 118 15.1 - memory mapping .................................................................................................. 118 15.1.1 - can1 .................................................................................................................. ........ 118 15.1.2 - can2 .................................................................................................................. ........ 118 15.2 - can bus configurations .................................................................................. 118 15.3 - register and message object organization .......................................... 119 15.4 - can interrupt handling ................................................................................. 121 15.5 - the message object .......................................................................................... 124 15.6 - arbitration registers ...................................................................................... 126 16 - watchdog timer .................................................................................................. 127 17 - system reset ........................................................................................................ 129 17.1 - asynchronous reset (long hardware reset) ....................................... 129 17.2 - synchronous reset (warm reset) .............................................................. 130
st10f280 5/186 17.3 - software reset .................................................................................................. 131 17.4 - watchdog timer reset ..................................................................................... 131 17.5 - rstout pin and bidirectional reset ............................................................ 131 17.6 - reset circuitry ................................................................................................... 132 18 - power reduction modes ................................................................................. 135 18.1 - idle mode ............................................................................................................... .135 18.2 - power down mode .............................................................................................. 135 18.2.1 - protected power down mode ..................................................................................... 136 18.2.2 - interruptable power down mode ................................................................................ 136 19 - special function register overview ......................................................... 139 19.1 - identification registers ................................................................................. 148 19.2 - system configuration registers ................................................................ 149 20 - electrical characteristics ......................................................................... 155 20.1 - absolute maximum ratings ............................................................................. 155 20.2 - parameter interpretation ............................................................................. 155 20.3 - dc characteristics ........................................................................................... 155 20.3.1 - a/d converter characteristics .................................................................................... 158 20.3.2 - conversion timing control ....................................................................................... 159 20.4 - ac characteristics ............................................................................................ 160 20.4.1 - test waveforms ...................................................................................................... .160 20.4.2 - definition of internal timing ........................................................................................ 1 60 20.4.3 - clock generation modes ............................................................................................ 161 20.4.4 - prescaler operation ................................................................................................... .162 20.4.5 - direct drive .......................................................................................................... ....... 162 20.4.6 - oscillator watchdog (owd) ....................................................................................... 162 20.4.7 - phase locked loop .................................................................................................... 1 62 20.4.8 - external clock drive xtal1 ....................................................................................... 163 20.4.9 - memory cycle variables ............................................................................................. 164 20.4.10 - multiplexed bus ...................................................................................................... .... 165 20.4.11 - demultiplexed bus .................................................................................................... .. 171 20.4.12 - clkout and ready ................................................................................................. 177 20.4.13 - external bus arbitration ............................................................................................. .179 20.4.14 - high-speed synchronous serial interface (ssc) timing ........................................... 181 20.4.14.1 master mode........................................................................................................... ..... 181 20.4.14.2 slave mode............................................................................................................ ...... 182 21 - package mechanical data ........................................................................... 183 22 - ordering information ...................................................................................... 184
st10f280 6/186 1 - introduction the st10f280 is a new derivative of the st microelectronics st10 family of 16-bit single-chip cmos microcontrollers. it combines high cpu performance (up to 20 million instructions per second) with high peripheral functionality and enhanced i/o-capabilities. it also provides on-chip high-speed single voltage flash memory, on-chip high-speed ram, and clock generation via pll. st10f280 is processed in 0.35 m m cmos technology. the mcu core and the logic is supplied with a 5v to 3.3v on chip voltage regulator. the part is supplied with a single 5v supply and i/os work at 5v. the device is upward compatible with the st10f269 device, with the following set of differences: C two supply pins (dc1,dc2) on the pbga-208 package are used for decoupling the internally generated 3.3v core logic supply. do not con- nect these two pins to 5.0v external supply. in- stead, these pins should be connected to a decoupling capacitor (ceramic type, value 3 330nf). C the a/d converter characteristics stay identical but 16 new input channel are added. a bit in a new register (xadcmux) control the multiplex- age between the first block of 16 channel (on port5) and the second block (on xport10). the conversion result registers stay identical and the software management can determine the block in use. a new dedicated timer controls now the adc channel injection mode on the input cc31 (p7.7). the output of this timer is visible on a dedicated pin (xadcinj) to emulate this new functionnality. C a second xpwm peripheral (4 new channels) is added. four dedicated pins are reserved for the outputs (xpwm[0:3]) C a new general purpose i/o port named xport9 (16 bits) is added. due to the bit addressing management, it will be different from other standard general purpose i/o ports. figure 1 : logic symbol xtal1 rstin xtal2 rstout nmi ea ready ale rd wr /wrl port 5 16-bit port 6 8-bit port 4 8-bit port 3 15-bit port 2 16-bit port 1 16-bit port 0 16-bit v dd v ss port 7 8-bit port 8 8-bit v aref v agnd xport 9 16-bit xpwm 4-bit xadcinj xport10 16-bit dc1 dc2 decoupling capacitor for internal regulator st10f280
st10f280 7/186 2 - ball data the st10f280 package is a pbga of 23 x 23 x 1.96 mm. the pitch of the balls is 1.27 mm. the signal assignment of the 208 balls is described in figure 2 for the configuration and in table 1 for the ball signal assignment. this package has 25 additional thermal balls. figure 2 : ball configuration (bottom view) k7 v ss k8 v ss k9 v ss j7 v ss j8 v ss j9 v ss h7 v ss h8 v ss h9 v ss g7 v ss g8 v ss g9 v ss k10 v ss k11 v ss j10 v ss j11 v ss h10 v ss h11 v ss g10 v ss g11 v ss v ss v ss v ss v ss v ss u1 u2 v aref u3 v agnd u4 u5 u6 u7 u8 u9 u10 v ss u11 dc2 u12 u13 u14 u15 u16 t1 t2 t3 t4 t5 t6 t7 t8 t9 t10 t11 t12 t13 t14 t15 t16 r1 r2 r3 r4 r14 r15 r16 m1 m2 m3 m15 m16 m17 l1 v ss l2 l3 l15 l16 l17 v dd k1 v dd k2 k3 k15 k16 k17 v ss j1 j2 j3 j15 j16 j17 h1 h2 h3 h15 h16 h17 g1 g2 g3 g15 g16 g17 f1 f2 f3 f15 f16 f17 e1 e2 e3 e15 e16 e17 v ss d1 d2 d3 d15 d16 d17 c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 c15 c16 b1 b2 b3 b4 b5 b6 b7 b8 b9 b10 b11 b12 b13 b14 b15 b16 a1 a2 a3 a4 rstin a5 xtal1 a6 xtal2 a7 a8 a9 a10 a11 a12 a13 a14 a15 a16 a b c d e f g h j k l m n p r t a b c d e f g h j k l m n p r t 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 17 16 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 u17 t17 r17 c17 b17 a17 u u v ss dc1 v dd m4 l4 k4 j4 h4 g4 e4 d4 m14 l14 k14 j14 h14 g14 e14 d14 p15 p16 p17 p14 d5 d6 d7 d8 d9 d10 d11 d12 d13 p5 p6 p7 p8 p9 p10 p11 p12 p13 n1 n2 n3 n4 f4 f14 l7 l8 l9 l10 l11 v dd v dd v ss v dd v ss v dd v ss v dd v ss v ss v dd v ss v dd p3.15 v dd v ss rpd xp10.3 xp10.2 xp10.1 xp10.0 xp10.4 xp10.5 xp10.6 xp10.7 xp10.11 xp10.8 p5.6 p5.10 p5.14 xp10.9 xp10.10 xp10.13 xp10.12 p5.1 p5.3 p5.7 p5.11 p5.15 xp10.14 p5.0 p5.2 p5.4 p5.8 p5.12 xp10.15 p5.5 p5.9 p5.13 xpwm.0 xpwm.1 xpwm.2 xpwm.3 p6.0 p6.1 p6.2 p6.3 p6.4 p6.5 p6.6 p6.7 p8.0 p8.1 p8.2 p8.3 p8.4 p8.5 p8.6 p8.7 p7.0 p7.1 p7.2 p7.3 p7.4 p7.5 p7.6 p7.7 xadcinj p2.0 p2.1 p2.2 p2.3 p2.4 p2.5 p2.6 p2.7 p2.8 p2.9 p2.10 p2.11 p2.12 p2.13 p2.14 p2.15 p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 p3.7 p3.8 p3.9 p3.10 p3.11 p3.12 p3.13 p4.0 p4.1 p4.2 p4.3 p4.4 p4.5 p4.6 p4.7 rd wr ready ale ea p0.0 p0.1 p0.2 p0.3 p0.4 p0.5 p0.6 p0.7 p0.8 p0.9 p0.10 p0.11 p0.12 p0.13 p0.14 p0.15 xp9.0 xp9.1 xp9.2 xp9.3 xp9.4 xp9.5 xp9.6 xp9.7 xp9.8 xp9.9 xp9.10 xp9.11 xp9.12 xp9.13 xp9.14 xp9.15 p1.0 p1.1 p1.2 p1.3 p1.4 p1.5 p1.6 p1.7 p1.8 p1.9 p1.10 p1.11 p1.12 p1.13 p1.14 p1.15 v ss rstout nmi v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss v ss r5 r6 r7 r8 r9 r10 r11 r12 r13 n15 n16 n17 n14 p1 p2 p3 p4
st10f280 8/186 table 1 : ball description symbol ball number type function p6.0 C p6.7 i/o port 6 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 6 outputs can be configured as push/pull or open drain drivers. the following port 6 pins also serve for alternate functions: e4 o p6.0 cs0 chip select 0 output d3 o p6.1 cs1 chip select 1 output b1 o p6.2 cs2 chip select 2 output c1 o p6.3 cs3 chip select 3 output d2 o p6.4 cs4 chip select 4 output e3 i p6.5 hold external master hold request input f4 o p6.6 hlda hold acknowledge output d1 o p6.7 breq bus request output p8.0 C p8.7 i/o port 8 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 8 outputs can be configured as push/pull or open drain drivers. the input threshold of port 8 is selectable (ttl or special). the following port 8 pins also serve for alternate functions: e2 i/o p8.0 cc16io capcom2: cc16 capture input / compare output f3 i/o p8.1 cc17io capcom2: cc17 capture input / compare output f2 i/o p8.2 cc18io capcom2: cc18 capture input / compare output g3 i/o p8.3 cc19io capcom2: cc19 capture input / compare output g2 i/o p8.4 cc20io capcom2: cc20 capture input / compare output h4 i/o p8.5 cc21io capcom2: cc21 capture input / compare output h3 i/o p8.6 cc22io capcom2: cc22 capture input / compare output h2 i/o p8.7 cc23io capcom2: cc23 capture input / compare output p7.0 C p7.7 i/o port 7 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 7 outputs can be configured as push/pull or open drain drivers. the input threshold of port 7 is selectable (ttl or special). the following port 7 pins also serve for alternate functions: j4 o p7.0 pout0 pwm channel 0 output j3 o p7.1 pout1 pwm channel 1 output j2 o p7.2 pout2 pwm channel 2 output j1 o p7.3 pout3 pwm channel 3 output k2 i/o p7.4 cc28io capcom2: cc28 capture input / compare output k3 i/o p7.5 cc29io capcom2: cc29 capture input / compare output k4 i/o p7.6 cc30io capcom2: cc30 capture input / compare output l2 i/o p7.7 cc31io capcom2: cc31 capture input / compare output
st10f280 9/186 xp10.0 C xp10.15 i xport 10 is a 16-bit input-only port with schmitt-trigger characteristics. the pins of xport10 also serve as the analog input channels (up to 16) for the a/d converter, where xp10.x equals anx (analog input channel x). m4 m3 m2 m1 n4 n3 n2 n1 p4 p3 p2 p1 r2 r1 t1 u1 i i i i i i i i i i i i i i i i xp10.0 xp10.1 xp10.2 xp10.3 xp10.4 xp10.5 xp10.6 xp10.7 xp10.8 xp10.9 xp10.10 xp10.11 xp10.12 xp10.13 xp10.14 xp10.15 p5.0 C p5.15 i port 5 is a 16-bit input-only port with schmitt-trigger characteristics. the pins of port 5 also serve as the analog input channels (up to 16) for the a/d converter, where p5.x equals anx (analog input channel x), or they serve as timer inputs: t2 i p5.0 r3 i p5.1 t3 i p5.2 r4 i p5.3 t4 i p5.4 u4 i p5.5 p5 i p5.6 r5 i p5.7 t5 i p5.8 u5 i p5.9 p6 i p5.10 t6eud gpt2 timer t6 external up / down control input r6 i p5.11 t5eud gpt2 timer t5 external up / down control input t6 i p5.12 t6in gpt2 timer t6 count input u6 i p5.13 t5in gpt2 timer t5 count input p7 i p5.14 t4eud gpt1 timer t4 external up / down control input r7 i p5.15 t2eud gpt1 timer t2 external up / down control input table 1 : ball description (continued) symbol ball number type function
st10f280 10/186 p2.0 C p2.15 i/o port 2 is a 16-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port 2 outputs can be configured as push/pull or open drain drivers. the input threshold of port 2 is selectable (ttl or special). the following port 2 pins also serve for alternate functions: t7 i/o p2.0 cc0io capcom: cc0 capture input / compare output p8 i/o p2.1 cc1io capcom: cc1 capture input / compare output r8 i/o p2.2 cc2io capcom: cc2 capture input / compare output t8 i/o p2.3 cc3io capcom: cc3 capture input / compare output t9 i/o p2.4 cc4io capcom: cc4 capture input / compare output p9 i/o p2.5 cc5io capcom: cc5 capture input / compare output r9 i/o p2.6 cc6io capcom: cc6 capture input / compare output u9 i/o p2.7 cc7io capcom: cc7 capture input / compare output t10 i/o i p2.8 cc8io capcom: cc8 capture input / compare output, ex0in fast external interrupt 0 input r10 i/o i p2.9 cc9io capcom: cc9 capture input / compare output, ex1in fast external interrupt 1 input p10 i/o i p2.10 cc10io capcom: cc10 capture input / compare output, ex2in fast external interrupt 2 input t11 i/o i p2.11 cc11io capcom: cc11 capture input / compare output, ex3in fast external interrupt 3 input r11 i/o i p2.12 cc12io capcom: cc12 capture input / compare output, ex4in fast external interrupt 4 input u12 i/o i p2.13 cc13io capcom: cc13 capture input / compare output, ex5in fast external interrupt 5 input p11 i/o i p2.14 cc14io capcom: cc14 capture input / compare output, ex6in fast external interrupt 6 input t12 i/o i i p2.15 cc15io capcom: cc15 capture input / compare output, ex7in fast external interrupt 7 input t7in capcom2 timer t7 count input table 1 : ball description (continued) symbol ball number type function
st10f280 11/186 p3.0 - p3.13, p3.15 i/o port 3 is a 15-bit (p3.14 is missing) bidirectional i/o port. it is bit-wise program- mable for input or output via direction bits. for a pin configured as input, the out- put driver is put into high-impedance state. port 3 outputs can be configured as push/pull or open drain drivers. the input threshold of port 3 is selectable (ttl or special). the following port 3 pins also serve for alternate functions: r12 i p3.0 t0in capcom timer t0 count input t13 o p3.1 t6out gpt2 timer t6 toggle latch output p12 i p3.2 capin gpt2 register caprel capture input r13 o p3.3 t3out gpt1 timer t3 toggle latch output t14 i p3.4 t3eud gpt1 timer t3 external up / down control input p13 i p3.5 t4in gpt1 timer t4 input for count / gate / reload / capture r14 i p3.6 t3in gpt1 timer t3 count / gate input p14 i p3.7 t2in gpt1 timer t2 input for count / gate / reload / capture r15 i/o p3.8 mrst ssc master-receive / slave-transmit i/o r16 i/o p3.9 mtsr ssc master-transmit / slave-receive o/i n14 i/o p3.10 txd0 asc0 clock / data output (asynchronous / synchronous) p15 o p3.11 rxd0 asc0 data input (asynchronous) or i/o (synchronous) p16 o p3.12 bhe external memory high byte enable signal, wrh external memory high byte write strobe m14 i/o p3.13 sclk ssc master clock output / slave clock input t17 o p3.15 clkout system clock output (=cpu clock) p4.0 C p4.7 i/o port 4 is an 8-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. the input threshold is selectable (ttl or special). p4.6 & p4.7 outputs can be configured as push-pull or open-drain drivers. in case of an external bus configuration, port 4 can be used to output the seg- ment address lines: n16 o p4.0 a16 least significant segment address line m15 o p4.1 a17 segment address line l14 o p4.2 a18 segment address line m16 o p4.3 a19 segment address line l15 o i p4.4 a20 segment address line can2_rxd can2 receive data input l16 o i p4.5 a21 segment address line can1_rxd can1 receive data input k14 o o p4.6 a22 segment address line, can_txd can1_txd can1 transmit data output k15 o o p4.7 a23 most significant segment address line can2_txd can2 transmit data output table 1 : ball description (continued) symbol ball number type function
st10f280 12/186 rd j14 o external memory read strobe. rd is activated for every external instruction or data read access. wr /wrl j15 o external memory write strobe. in wr -mode this pin is activated for every external data write access. in wrl -mode this pin is activated for low byte data write accesses on a 16-bit bus, and for every data write access on an 8-bit bus. see wrcfg in register syscon for mode selection. ready/ ready j16 i ready input. the active level is programmable. when the ready function is enabled, the selected inactive level at this pin during an external memory access will force the insertion of memory cycle time waitstates until the pin returns to the selected active level. ale j17 o address latch enable output. can be used for latching the address into external memory or an address latch in the multiplexed bus modes. ea h17 i external access enable pin. a low level at this pin during and after reset forces the st10f280 to begin instruction execution out of external memory. a high level forces execution out of the internal flash memory. port0: p0l.0 - p0l.7, p0h.0 - p0h.7 i/o port0 consists of the two 8-bit bidirectional i/o ports p0l and p0h. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. in case of an external bus configuration, port0 serves as the address (a) and address/data (ad) bus in multiplexed bus modes and as the data (d) bus in demultiplexed bus modes. demultiplexed bus modes: data path width: 8-bit 16-bit p0l.0 C p0l.7: d0 - d7 d0 - d7 p0h.0 C p0h.7: i/o d8 - d15 multiplexed bus modes: data path width: 8-bit 16-bit p0l.0 C p0l.7: ad0 - ad7 ad0 - ad7 p0h.0 C p0h.7: a8 - a15 ad8 - ad15 h16 i/o p0l.0 h15 i/o p0l.1 h14 i/o p0l.2 g16 i/o p0l.3 g15 i/o p0l.4 g14 i/o p0l.5 f16 i/o p0l.6 e17 i/o p0l.7 f15 i/o p0h.0 e16 i/o p0h.1 f14 i/o p0h.2 d17 i/o p0h.3 e15 i/o p0h.4 d16 i/o p0h.5 c17 i/o p0h.6 e14 i/o p0h.7 table 1 : ball description (continued) symbol ball number type function
st10f280 13/186 xport9.0 - xport9.15 i/o xport 9 is a 16-bit bidirectional i/o port. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. xport 9 outputs can be configured as push/pull or open drain drivers. d15 i/o xport9.0 c16 i/o xport9.1 d14 i/o xport9.2 c15 i/o xport9.3 b16 i/o xport9.4 d13 i/o xport9.5 c14 i/o xport9.6 b15 i/o xport9.7 a15 i/o xport9.8 b14 i/o xport9.9 c13 i/o xport9.10 d12 i/o xport9.11 b13 i/o xport9.12 c12 i/o xport9.13 d11 i/o xport9.14 b12 i/o xport9.15 table 1 : ball description (continued) symbol ball number type function
st10f280 14/186 port1: p1l.0 - p1l.7, p1h.0 - p1h.7 i/o port1 consists of the two 8-bit bidirectional i/o ports p1l and p1h. it is bit-wise programmable for input or output via direction bits. for a pin configured as input, the output driver is put into high-impedance state. port1 is used as the 16-bit address bus (a) in demultiplexed bus modes and also after switching from a demultiplexed bus mode to a multiplexed bus mode. the following port1 pins also serve for alternate functions: c11 i/o p1l.0 b11 i/o p1l.1 d10 i/o p1l.2 c10 i/o p1l.3 b10 i/o p1l.4 a10 i/o p1l.5 d9 i/o p1l.6 c9 i/o p1l.7 c8 i/o p1h.0 d8 i/o p1h.1 a7 i/o p1h.2 b7 i/o p1h.3 c7 i p1h.4 cc24io capcom2: cc24 capture input d7 i p1h.5 cc25io capcom2: cc25 capture input c5 i p1h.6 cc26io capcom2: cc26 capture input c6 i p1h.7 cc27io capcom2: cc27 capture input xtal1 a5 i xtal1: input to the oscillator amplifier and input to the internal clock generator xtal2 a6 o xtal2: output of the oscillator amplifier circuit. to clock the device from an external source, drive xtal1, while leaving xtal2 unconnected. minimum and maximum high/low and rise/fall times specified in the ac characteristics must be observed. rstin a3 i reset input with schmitt-trigger characteristics. a low level at this pin for a spec- ified duration while the oscillator is running resets the st10f280. an internal pul- lup resistor permits power-on reset using only a capacitor connected to v ss . in bidirectional reset mode (enabled by setting bit bdrsten in syscon regis- ter), the rstin line is pulled low for the duration of the internal reset sequence. rstout b4 o internal reset indication output. this pin is set to a low level when the part is executing either a hardware, a software or a watchdog timer reset. rstout remains low until the einit (end of initialization) instruction is executed. nmi c4 i non-maskable interrupt input. a high to low transition at this pin causes the cpu to vector to the nmi trap routine. if bit pwdcfg = 0 in syscon register, when the pwrdn (power down) instruction is executed, the nmi pin must be low in order to force the st10f280 to go into power down mode. if nmi is high and pwdcfg =0, when pwrdn is executed, the part will continue to run in normal mode. if not used, pin nmi should be pulled high externally. table 1 : ball description (continued) symbol ball number type function
st10f280 15/186 xpwm.0 d4 o xpwm channel 0 output xpwm.1 c3 o xpwm channel 1 output xpwm.2 b2 o xpwm channel 2 output xpwm.3 c2 o xpwm channel 3 output xadcinj l3 o output trigger for adc channel injection v aref u2 - reference voltage for the a/d converter. v agnd u3 - reference ground for the a/d converter. rpd m17 i/o timing pin for the return from powerdown circuit and synchronous/asynchronous reset selection. dc1 g1 o 3.3v decoupling pin: a decoupling capacitor of ~330 nf must be connected between this pin and nearest v ss pin. dc2 u11 o 3.3v decoupling pin: a decoupling capacitor of ~330 nf must be connected between this pin and v ss nearest pin. v dd a2 a9 a12 a14 e1 k1 u8 u15 p17 l17 g17 - digital supply voltage: + 5 v during normal operation, idle mode and power down mode table 1 : ball description (continued) symbol ball number type function
st10f280 16/186 v ss a1 a4 a8 a11 a13 a16 a17 b3 b5 b6 b8 b9 b17 d5 d6 f1 f17 g4 h1 k16 k17 l1 l4 n15 n17 r17 t15 t16 u7 u10 u13 u14 u16 u17 - digital ground. table 1 : ball description (continued) symbol ball number type function
st10f280 17/186 3 - functional description the architecture of the st10f280 combines advantages of both risc and cisc processors and an advanced peripheral subsystem. the block diagram gives an overview of the different on-chip components and the high bandwidth inter- nal bus structure of the st10f280. figure 3 : block diagram p4.7 can2_txd p4.6 can1_txd p4.5 can1_rxd p4.4 can2_rxd port 0 port 1 port 4 port 6 port 5 por t 3 port 2 gpt1 gpt2 asc usart brg cpu-core and mac unit internal ram watchdog interrupt controller 8 32 16 pec 16 16 can1 port 7 port 8 external bus 10-bit adc brg ssc pwm capcom2 capcom1 16 oscillator controller 16 16 512k byte and pll flash memory xtal1 xtal2 2k byte 15 8 8 8 16 3.3v voltage regulator 16k byte xram can2 xport9 16 xpwm 4 xtimer p7.7 trigger for adc 16 xport10 16 16 xadcinj channel injection external connexion
st10f280 18/186 4 - memory organization the memory space of the st10f280 is configured in a unified memory architecture. code memory, data memory, registers and i/o ports are orga- nized within the same linear address space of 16m bytes. the entire memory space can be accessed bytewise or wordwise. particular por- tions of the on-chip memory have additionally been made directly bit addressable. flash: 512k bytes of on-chip single voltage flash memory. iram: 2k bytes of on-chip internal ram (dual-port) is provided as a storage for data, sys- tem stack, general purpose register banks and code. the register bank can consist of up to 16 wordwide (r0 to r15) and/or bytewide (rl0, rh0, , rl7, rh7) general purpose registers. base address is 00f600h, upper address is 00fdffh. xram: 16k bytes of on-chip extension ram (sin- gle port xram) is provided as a storage for data, user stack and code. the xram is a single bank, connected to the internal xbus and are accessed like an external memory in 16-bit demultiplexed bus-mode without waitstate or read/write delay (50ns access at 40mhz cpu clock). byte and word access is allowed. the xram address range is 008000h - 00bfffh if enabled (xpen set bit 2 of syscon register-, and xramen set bit 2 of xpercon register-). if bit xramen or xpen is cleared, then any access in the address range 008000h 00bfffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register as the xram appears like external memory, it cannot be used for the st10f280s system stack or register banks. the xram is not provided for single bit storage and therefore is not bit address- able. sfr/esfr : 1024 bytes (2 * 512 bytes) of address space is reserved for the special function register areas. sfrs are wordwide registers which are used for controlling and monitoring functions of the different on-chip units. can1: address range 00ef00h 00efffh is reserved for the can1 module access. the can1 is enabled by setting xpen bit 2 of the syscon register and bit 0 of the new xpercon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate wait- state is used. can2: address range 00ee00h 00eeffh is reserved for the can2 module access. the can2 is enabled by setting xpen bit 2 of the syscon register and bit 1 of the new xpercon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate wait- state is used. in order to meet the needs of designs where more memory is required than is provided on chip, up to 16m bytes of external ram and/or rom can be connected to the microcontroller. if one or the two can modules are used, port 4 can not be pro- grammed to output all 8 segment address lines. thus, only 4 segment address lines can be used, reducing the external memory space to 5m bytes (1m byte per cs line). xpwm: address range 00ec00h 00ecffh is reserved for the xpwm module access. the xpwm is enabled by setting xpen bit 2 of the syscon register and bit 4 of the new xpercon register. accesses to the xpwm module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate waitstate is used. xport9, xtimer, xport10, xadcmux : address range 00c000h 00c3ffh is reserved for the xport9, xport10, xtimer and xadcmux peripherals access. the xport9, xtimer, xport10, xadcmux are enabled by setting xpen bit 2 of the syscon register and the bit 3 of the new xpercon register. accesses to the xport9, xtimer, xport10 and xadcmux modules use a 16-bit demultiplexed bus mode without waitstate or read/write delay (50ns access at 40mhz cpu clock). byte and word access is allowed. visibility of xbus peripherals the xbus peripherals can be separately selected for being visible to the user by means of corre- sponding selection bits in the xpercon register. if not selected (not activated with xpercon bit) before the global enabling with xpen-bit in syscon register, the corresponding address space, port pins and interrupts are not occupied by the peripheral, thus the peripheral is not visible and not available. syscon register is described in section 19.2 - system configuration registers.
st10f280 19/186 figure 4 : st10f280 on-chip memory mapping 14 07 06 05 04 004000 01 00 000000 02 00c000 00ffff sfr : 512 bytes 00fe00 00fdff iram : 2k bytes 00f600 * blocks 0, 1 and 2 may be remapped from segment 0 to segment 1 by setting syscon-roms1 (before einit) ram, sfr and x-pheripherals are mapped into the address space. segment 4 segment 3 segment 2 segment 1 segment 0 data page number absolute memory address 006000 00f1ff esfr : 512 bytes 00f000 00efff can1 : 256 bytes 00ef00 00eeff can2 : 256 bytes 00ee00 00c3ff xport9 xtimer 00c000 03 00ecff xpwm 00ec00 block2 = 8k bytes internal flash memory block1 = 8k bytes block0 = 16k bytes 010000 018000 020000 030000 0c 040000 10 050000 block6 = 64k bytes block5 = 64k bytes block4 = 64k bytes block3 = 32k bytes block2* block1* block0* data page number and absolute memory address are hexadecimal values. 08 080000 20 block10 = 64k bytes segment 8 090000 008000 00bfff xram = 16k bytes xport10 xadcmux
st10f280 20/186 xpercon (f024h / 12h) esfr reset value: - - 05h note: - when both can and xpwm are disabled via xpercon setting, then any access in the address range 00ec00h 00efffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register. p4.4 and p4.7 can be used as general purpose i/o when can2 is not enabled, and p4.5 and p4.6 can be used as general purpose i/o when can1 is not enabled. - the default xper selection after reset is : xcan1 is enabled, xcan2 is disabled, xram is enabled, xport9, xtimer, xport10, xpwm, xadcmux are disabled. - register xpercon cannot be changed after the global enabling of xperipherals, i.e. after setting of bit xpen in syscon register. 15141312111098765 4 3 2 1 0 -----------xpwmenxperconen3xramencan2encan1en rw rw rw rw rw bit function can1en 0 1 can1 enable bit accesses to the on-chip can1 xperipheral and its functions are disabled. p4.5 and p4.6 pins can be used as general purpose i/os. address range 00ef00h-00efffh is only directed to external memory if can2en and xpwm bits are cleared also. the on-chip can1 xperipheral is enabled and can be accessed. can2en 0 1 can2 enable bit accesses to the on-chip can2 xperipheral and its functions are disabled. p4.4 and p4.7 pins can be used as general purpose i/os. address range 00ee00h-00eeffh is only directed to external memory if can1en and xpwm bits are cleared also. the on-chip can2 xperipheral is enabled and can be accessed. xramen 0 1 xram enable bit accesses to the on-chip 16k byte xram are disabled, external access performed. the on-chip 16k byte xram is enabled and can be accessed. xperconen3 0 1 xport9, xtimer, xport10, xadcmux enable bit accesses to the xport9, xtimer, xport10, xadcmux peripherals are disabled, external access performed. the on-chip xport9, xtimer, xport10, xadcmux peripherals are enabled and can be accessed. xpwmen 0 1 xpwm enable bit accesses to the on-chip xpwm are disabled, external access performed. address range 00ec00h-00ecffh is only directed to external memory if can1en and can2en are 0 also the on-chip xpwm is enabled and can be accessed.
st10f280 21/186 5 - internal flash memory 5.1 - overview C 512k byte on-chip flash memory C two possibilities of flash mapping into the cpu address space C flash memory can be used for code and data storage C 32-bit, zero waitstate read access (50ns cycle time at f cpu = 40mhz) C erase-program controller (epc) similar to m29f400b stms stand-alone flash memory ? word-by-word programmable (16 m s typical) ? data polling and toggle protocol for epc status ? internal power-on detection circuit C memory erase in blocks ? one 16k byte, two 8k byte, one 32k byte, seven 64k byte blocks ? each block can be erased separately (1.5 second typical) ? chip erase (8.5 second typical) ? each block can be separately protected against programming and erasing ? each protected block can be temporary unpro- tected ? when enabled, the read protection prevents access to data in flash memory using a pro- gram running out of the flash memory space. access to data of internal flash can only be per- formed with an inner protected program C erase suspend and resume modes ? read and program another block during erase suspend C single voltage operation , no need of dedicated supply pin C low power consumption: ? 45ma max. read current ? 60ma max. program or erase current ? automatic stand-by-mode (50 m a maximum) C 100,000 erase-program cycles per block, 20 year data retention time C operating temperature: -40 to +125 o c 5.2 - operational overview read mode in standard mode (the normal operating mode) the flash appears like an on-chip rom with the same timing and functionality. the flash module offers a fast access time, allowing zero waitstate access with cpu frequency up to 40mhz. instruction fetches and data operand reads are performed with all addressing modes of the st10f280 instruction set. in order to optimize the programming time of the internal flash, blocks of 8k bytes, 16k bytes, 32k bytes, 64k bytes can be used. but the size of the blocks does not apply to the whole memory space, see details in table 2. table 2 : 512k byte flash memory block organisation block addresses (segment 0) addresses (segment 1) size (k byte) 0 1 2 3 4 5 6 7 8 9 10 000000h to 003fffh 004000h to 005fffh 006000h to 007fffh 018000h to 01ffffh 020000h to 02ffffh 030000h to 03ffffh 040000h to 04ffffh 050000h to 05ffffh 060000h to 06ffffh 070000h to 07ffffh 080000h to 08ffffh 010000h to 013fffh 014000h to 015fffh 016000h to 017fffh 018000h to 01ffffh 020000h to 02ffffh 030000h to 03ffffh 040000h to 04ffffh 050000h to 05ffffh 060000h to 06ffffh 070000h to 07ffffh 080000h to 08ffffh 16 8 8 32 64 64 64 64 64 64 64
st10f280 22/186 instructions and commands all operations besides normal read operations are initiated and controlled by command sequences written to the flash command interface (ci). the command interface (ci) interprets words written to the flash memory and enables one of the following operations: C read memory array C program word C block erase C chip erase C erase suspend C erase resume C block protection C block temporary unprotection C code protection commands are composed of several write cycles at specific addresses of the flash memory. the different write cycles of such command sequences offer a fail-safe feature to protect against an inadvertent write. a command only starts when the command interface has decoded the last write cycle of an operation. until that last write is performed, flash memory remains in read mode notes: 1. as it is not possible to perform write operations in the flash while fetching code from flash, the flash commands must be written by instructions executed from internal ram or external memory. 2. command write cycles do not need to be consecutively received, pauses are allowed, save for block erase command. during this operation all erase confirm commands must be sent to complete any block erase operation before time-out period expires (typically 96 m s). command sequencing must be followed exactly. any invalid combination of commands will reset the command interface to read mode. status register this register is used to flag the status of the memory and the result of an operation. this register can be accessed by read cycles during the erase-program controller (epc) operation. erase operation this flash memory features a block erase architecture with a chip erase capability too. erase is accomplished by executing the six cycle erase command sequence. additional command write cycles can then be performed to erase more than one block in parallel. when a time-out period elaps (96 m s) after the last cycle, the erase-program controller (epc) automatically starts and times the erase pulse and executes the erase operation. there is no need to program the block to be erased with 0000h before an erase operation. termination of operation is indicated in the flash status register. after erase operation, the flash memory locations are read as 'ffffh value. erase suspend a block erase operation is typically executed within 1.5 second for a 64k byte block. erasure of a memory block may be suspended, in order to read data from another block or to program data in another block, and then resumed. in-system programming in-system programming is fully supported. no special programming voltage is required. because of the automatic execution of erase and programming algorithms, write operations are reduced to transferring commands and data to the flash and reading the status. any code that programs or erases flash memory locations (that writes data to the flash) must be executed from memory outside the on-chip flash memory itself (on-chip ram or external memory). a boot mechanism is provided to support in-system programming. it works using serial link via usart interface and a pc compatible or other programming host. read/write protection the flash module supports read and write protection in a very comfortable and advanced protection functionality. if read protection is installed, the whole flash memory is protected against any "external" read access; read accesses are only possible with instructions fetched directly from program flash memory. for update of the flash memory a temporary disable of flash read protection is supported. the device also features a block write protection. software locking of selectable memory blocks is provided to protect code and data. this feature will disable both program and erase operations in the selected block(s) of the memory. block protection is accomplished by block specific lock-bit which are programmed by executing a four cycle command sequence. the locked state of blocks is indicated by specific flags in the according block status registers. a block may only be temporarily unlocked for update (write) operations.
st10f280 23/186 with the two possibilities for write protection whole memory or block specific a flexible installation of write protection is supported to protect the flash memory or parts of it from unauthorized programming or erase accesses and to provide virus-proof protection for all system code blocks. all write protection also is enabled during boot operation. power supply, reset the flash module uses a single power supply for both read and write functions. internally gener- ated and regulated voltages are provided for the program and erase operations from 5v supply. once a program or erase cycle has been com- pleted, the device resets to the standard read mode. at power-on, the flash memory has a setup phase of some microseconds (dependent on the power supply ramp-up). during this phase, flash can not be read. thus, if ea pin is high (exe- cution will start from flash memory), the cpu will remains in reset state until the flash can be accessed. 5.3 - architectural description the flash module distinguishes two basic operating modes, the standard read mode and the command mode. the initial state after power-on and after reset is the standard read mode. 5.3.1 - read mode the flash module enters the standard operating mode, the read mode: C after reset command C after every completed erase operation C after every completed programming operation C after every other completed command execution C few microseconds after a cpu-reset has started C after incorrect address and data values of command sequences or writing them in an improper sequence C after incorrect write access to a read protected flash memory the read mode remains active until the last command of a command sequence is decoded which starts directly a flash array operation, such as: C erase one or several blocks C program a word into flash array C protect / temporary unprotect a block. in the standard read mode read accesses are directly controlled by the flash memory array, delivering a 32-bit double word from the addressed position. read accesses are always aligned to double word boundaries. thus, both low order address bit a1 and a0 are not used in the flash array for read accesses. the high order address bit a18/a17/a16 define the physical 64k bytes segment being accessed within the flash array. 5.3.2 - command mode every operation besides standard read operations is initiated by commands written to the flash command register. the addresses used for command cycles define in conjunction with the actual state the specific step within command sequences. with the last command of a command sequence, the erase-program controller (epc) starts the execution of the command. the epc status is indicated during command execution by: C the status register, C the ready/busy signal. 5.3.3 - flash status register the flash status register is used to flag the status of the flash memory and the result of an operation. this register can be accessed by read cycles during the program-erase controller operations. the program or erase operation can be controlled by data polling on bit fsb.7 of status register, detection of toggle on fsb.6 and fsb.2, or error on fsb.5 and erase timeout on fsb.3 bit. any read attempt in flash during epc operation will automatically output these five bits. the epc sets bit fsb.2, fsb.3, fsb.5, fsb.6 and fsb.7. other bit are reserved for future use and should be masked.
st10f280 24/186 flash status (see note for address) note: the address of flash status register is the address of the word being programmed when programming operation is in progress, or an address within block being erased when erasing operation is in progress. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 ------- - fsb.7 fsb.6 fsb.5 - fsb.3 fsb.2 - - rrr r r fsb.7 flash status bit 7: data polling bit programming operation: this bit outputs the complement of the bit 7 of the word being programmed, and after completion, will output the bit 7 of the word programmed. erasing operation: outputs a 0 during erasing, and 1 after erasing completion. if the block selected for erasure is (are) protected, fsb.7 will be set to 0 for about 100 s, and then return to the previous addressed memory data value. fsb.7 will also flag the erase suspend mode by switching from 0 to 1 at the start of the erase suspend. during program operation in erase suspend mode, fsb.7 will have the same behaviour as in normal program execution outside the suspend mode. fsb.6 flash status bit 6: toggle bit programming or erasing operations: successive read operations of flash status register will deliver complementary values. fsb.6 will toggle each time the flash status register is read. the program operation is completed when two successive reads yield the same value. the next read will output the bit last programmed, or a 1 after erase operation fsb.6 will be set to1 if a read operation is attempted on an erase suspended block. in addition, an erase suspend/resume command will cause fsb.6 to toggle. fsb.5 flash status bit 5: error bit this bit is set to 1 when there is a failure of program, block or chip erase operations.this bit will also be set if a user tries to program a bit to 1 to a flash location that is currently programmed with 0. the error bit resets after read/reset instruction. in case of success, the error bit will be set to 0 during program or erase and then will output the bit last programmed or a 1 after erasing fsb.3 flash status bit 3: erase time-out bit this bit is cleared by the epc when the last block erase command has been entered to the command interface and it is awaiting the erase start. when the time-out period is finished, after 96 s, fsb.3 returns back to 1. fsb.2 flash status bit 2: toggle bit this toggle bit, together with fsb.6, can be used to determine the chip status during the erase mode or erase suspend mode. it can be used also to identify the block being erased suspended. a read operation will cause fsb.2 to toggle during the erase mode. if the flash is in erase suspend mode, a read operation from the erase suspended block or a program operation into the erase suspended block will cause fsb.2 to toggle. when the flash is in program mode during erase suspend, fsb.2 will be read as 1 if address used is the address of the word being programmed. after erase completion with an error status, fsb.2 will toggle when reading the faulty sector.
st10f280 25/186 5.3.4 - flash protection register the flash protection register is a non-volatile register that contains the protection status. this register can be read by using the read protection status (rp) command, and programmed by using the dedi- cated set protection command. flash protection register (pr) 5.3.5 - instructions description twelve instructions dedicated to flash memory accesses are defined as follow: read/reset (rd). the read/reset instruction consist of one write cycle with data xxf0h . it can be optionally preceded by two ci enable coded cycles (data xxa8h at address 1554h + data xx54h at address 2aa8h). any successive read cycle following a read/reset instruction will read the memory array. a wait cycle of 10s is necessary after a read/reset command if the memory was in program or erase mode. program word (pw). this instruction uses four write cycles. after the two cl enable coded cycles, the program word command xxa0h is written at address 1554h. the following write cycle will latch the address and data of the word to be programmed. memory programming can be done only by writing 0's instead of 1's, otherwise an error occurs. during programming, the flash status is checked by reading the flash status bit fsb.2, fsb.5, fsb.6 and fsb.7 which show the status of the epc. fsb.2, fsb.6 and fsb.7 determine if programming is on going or has completed, and fsb.5 allows a check to be made for any possible error. block erase (be). this instruction uses a minimum of six command cycles. the erase enable command xx80h is written at address 1554h after the two-cycle ci enable sequence. the erase confirm code xx30h must be written at an address related to the block to be erased preceded by the execution of a second ci enable sequence. additional erase confirm codes must be given to erase more than one block in parallel. additional erase confirm commands must be written within a defined time-out period. the input of a new block erase command will restart the time-out period. when this time-out period has elapsed, the erase starts. the status of the internal timer can be monitored through the level of fsb.3, if fsb.3 is 0, the block erase command has been given and the timeout is running; if fsb.3 is 1, the timeout has expired and the epc is erasing the block(s). if the second command given is not an erase con- firm or if the coded cycles are wrong, the instruc- tion aborts, and the device is reset to read mode. 151413121110987654 3 2 10 cp ---- bp10 bp9 bp8 bp7 bp6 bp5 bp4 bp3 bp2 bp1 bp0 rw rw rw rw rw rw rw rw rw rw rw rw bpx block x protection bit (x = 0...10) 0: the block protection is enabled for block x. programming or erasing the block is not possible, unless a block temporary unprotection command is issued. 1: the block protection is disabled for block x. bit is 1 by default, and can be programmed permanently to 0 using the set protection command but then cannot be set to 1 again. it is therefore possible to temporally disable the block protection using the block temporary unprotection instruction. cp code protection bit 0: the flash code protection is enabled. read accesses to the flash for execution not performed in the flash itself are not allowed, the returned value will be 009bh, whatever the content of the flash is. 1: the flash code protection is disabled: read accesses to the flash from external or internal ram are allowed bit is 1 by default, and can be programmed permanently to 0 using the set protection command but then cannot be set to 1 again. it is therefore possible to temporarily disable the code protection using the code temporary unprotection instruction.
st10f280 26/186 it is not necessary to program the block with 0000h as the epc will do this automatically before the erasing to ffffh. read operations after the epc has started, output the flash status regis- ter. during the execution of the erase by the epc, the device accepts only the erase suspend and read/reset instructions. data polling bit fsb.7 returns 0 while the erasure is in progress, and 1 when it has completed. the toggle bit fsb.2 and fsb.6 toggle during the erase operation. they stop when erase is completed. after completion, the error bit fsb.5 returns 1 if there has been an erase failure because erasure has not completed even after the maximum number of erase cycles have been executed by the epc, in this case, it will be necessary to input a read/reset to the command interface in order to reset the epc. chip erase (ce) . this instruction uses six write cycles. the erase enable command xx80h, must be written at address 1554h after ci-enable cycles. the chip erase command xx10h must be given on the sixth cycle after a second ci-enable sequence. an error in command sequence will reset the ci to read mode. it is not necessary to program the block with 0000h as the epc will do this automatically before the erasing to ffffh. read operations after the epc has started output the flash status register. during the execution of the erase by the epc, data polling bit fsb.7 returns 0 while the erasure is in progress, and 1 when it has completed. the fsb.2 and fsb.6 bit toggle during the erase operation. they stop when erase is finished. the fsb.5 error bit returns "1" in case of failure of the erase operation. the error flag is set after the maximum number of erase cycles have been executed by the epc. in this case, it will be necessary to input a read/reset to the command interface in order to reset the epc. erase suspend (es). this instruction can be used to suspend a block erase operation by giving the command xxb0h without any specific address. no ci-enable cycles is required. erase suspend operation allows reading of data from another block and/or the programming in another block while erase is in progress. if this command is given during the time-out period, it will terminate the time-out period in addition to erase suspend. the toggle bit fsb.6, when monitored at an address that belongs to the block being erased, stops toggling when erase suspend command is effective, it happens between 0.1 m s and 15 m s after the erase suspend command has been written. the flash will then go in normal read mode, and read from blocks not being erased is valid, while read from block being erased will output fsb.2 toggling. during a suspend phase the only instructions valid are erase resume and program word. a read / reset instruction during erase suspend will definitely abort the erase and result in invalid data in the block being erased. erase resume (er). this instruction can be given when the memory is in erase suspend state. erase can be resumed by writing the command xx30h at any address without any cl-enable sequence. program during erase suspend. the program word instruction during erase suspend is allowed only on blocks that are not erase-suspended. this instruction is the same than the program word instruction. set protection (sp). this instruction can be used to enable both block protection (to protect each block independently from accidental erasing-pro- gramming operation) and code protection (to avoid code dump). the set protection command must be given after a special ci-protection enable cycles (see instruction table). the following write cycle, will program the protection register. to pro- tect the block x (x = 0 to 10), the data bit x must be at 0. to protect the code, bit 15 of the data must be 0. enabling block or code protection is per- manent and can be cleared only by stm. block temporary unprotection and code temporary unprotection instructions are available to allow the customer to update the code. note: 1. the new value programmed in protection register will only become active after a reset. 2. bit that are already at 0 in protection register must be confirmed at 0 also in data latched during the 4th cycle of set protection command, otherwise an error may occur. read protection status (rp). this instruction is used to read the block protection status and the code protection status. to read the protection register (see table 3), the ci-protection enable cycles must be executed followed by the command xx90h at address x2a54h. the following read cycles at any odd word address will output the block protection status. the read/ reset command xxf0h must be written to reset the protection interface. note: after a modification of protection register (using set protection command), the read protection status will return the new pr value only after a reset.
st10f280 27/186 block temporary unprotection (btu). this instruction can be used to temporary unprotect all the blocks from program / erase protection. the unprotection is disabled after a reset cycle. the block temporary unprotection command xxc1h must be given to enable block temporary unprotection. the command must be preceded by the ci-protection enable cycles and followed by the read/reset command xxf0h. set code protection (scp). this kind of protection allows the customer to protect the proprietary code written in flash. if installed and active, flash code protection prevents data operand accesses and program branches into the on-chip flash area from any location outside the flash memory itself. data operand accesses and branches to flash locations are only and exclusively allowed for instructions executed from the flash memory itself. every read or jump to flash performed from another memory (like internal ram, external memory) while code protection is enabled, will give the opcode 009bh related to trap #00 illegal instruction. the ci-protection enable cycles must be sent to set the code protection. by writing data 7fffh at any odd word address, the code protected status is stored in the flash protection register (pr). protection is permanent and cannot be cleared by the user. it is possible to temporarily disable the code protection using code temporary unprotection instruction. note: bits that are already at 0 in protection register must be confirmed at 0 also in data latched during the 4th cycle of set protection command, otherwise an error may occur. code temporary unprotection (ctu). this instruction must be used to temporary disable code protection. this instruction is effective only if executed from flash memory space. to restore the protection status, without using a reset, it is necessary to use a code temporary protection instruction. system reset will reset also the code temporary unprotected status. the code temporary unprotection command consists of the following write cycle: mov mem, rn ; this instruction must be executed from flash memory space where mem is an absolute address inside memory space, rn is a register loaded with data 0ffffh. code temporary protection (ctp). this instruction allows to restore code protection. this operation is effective only if executed from flash memory and is necessary to restore the protection status after the use of a code temporary unprotection instruction. the code temporary protection command consists of the following write cycle: mov mem, rn ; this instruction must be executed from flash memory space where mem is an absolute address inside memory space, rn is a register loaded with data 0fffbh. note that code temporary unprotection instruction must be used when it is necessary to modify the flash with protected code (scp), since the write/erase routines must be executed from a memory external to flash space. usually, the write/erase routines, executed in ram, ends with a return to flash space where a ctp instruction restore the protection.
st10f280 28/186 table 3 : instructions notes 1. address bit a14, a15 and above are dont care for coded address inputs. 2. x = dont care. 3. wa = write address: address of memory location to be programmed. 4. wd = write data: 16-bit data to be programmed 5. optional, additional blocks addresses must be entered within a time-out delay (96 s) after last write entry, timeout status can be verified through fsb.3 value. when full command is entered, read data polling or toggle bit until erase is completed or suspend ed. 6. read data polling or toggle bit until erase completes. 7. wpr = write protection register. to protect code, bit 15 of wpr must be 0. to protect block n (n=0,1,...), bit n of wpr mu st be 0. bit that are already at 0 in protection register must also be 0 in wpr, else a writing error will occurs (it is not po ssible to write a 1 in a bit already programmed at 0). 8. mem = any address inside the flash memory space. absolute addressing mode must be used (mov mem, rn), and instruction must be executed from flash memory space. 9. odd word address = 4n-2 where n = 0, 1, 2, 3..., ex. 0002h, 0006h... instruction mne cycle 1 st cycle 2 nd cycle 3 rd cycle 4 th cycle 5 th cycle 6 th cycle 7 th cycle read/reset rd 1+ addr. 1 x 2 read memory array until a new write cycle is initiated data xxf0h read/reset rd 3+ addr. 1 x1554h x2aa8h xxxxxh read memory array until a new write cycle is initiated data xxa8h xx54h xxf0h program word pw 4 addr. 1 x1554h x2aa8h x1554h wa 3 read data polling or toggle bit until program completes. data xxa8h xx54h xxa0h wd 4 block erase be 6 addr. 1 x1554h x2aa8h x1554h x1554h x2aa8h ba ba 5 data xxa8h xx54h xx80h xxa8h xx54h xx30h xx30h chip erase ce 6 addr. 1 x1554h x2aa8h x1554h x1554h x2aa8h x1554h note 6 data xxa8h xx54h xx80h xxa8h xx54h xx10h erase suspend es 1 addr. 1 x 2 read until toggle stops, then read or program all data needed from block(s) not being erased then resume erase. data xxb0h erase resume er 1 addr. 1 x 2 read data polling or toggle bit until erase completes or erase is supended another time. data xx30h set block/code protection sp 4 addr. 1 x2a54h x15a8h x2a54h any odd word address 9 data xxa8h xx54h xxc0h wpr 7 read protection status rp 4 addr. 1 x2a54h x15a8h x2a54h any odd word address 9 read protection register until a new write cycle is initiated. data xxa8h xx54h xx90h read pr block temporary unprotection btu 4 addr. 1 x2a54h x15a8h x2a54h x 2 data xxa8h xx54h xxc1h xxf0h code temporary unprotection ctu 1 addr. 1 mem 8 write cycles must be executed from flash. data ffffh code temporary protection ctp 1 addr. 1 mem 8 write cycles must be executed from flash. data fffbh
st10f280 29/186 C generally, command sequences cannot be written to flash by instructions fetched from the flash itself. thus, the flash commands must be written by instructions, executed from internal ram or external memory. C command cycles on the cpu interface need not to be consecutively received (pauses allowed). the cpu interface delivers dummy read data for not used cycles within command sequences. C all addresses of command cycles shall be defined only with register-indirect addressing mode in the according move instructions. direct addressing is not allowed for command sequences. address segment or data page pointer are taken into account for the command address value. 5.3.6 - reset processing and initial state the flash module distinguishes two kinds of cpu reset types the lengthening of cpu reset: C is not reported to external devices by bidirectional pin C is not enabled in case of external start of cpu after reset. 5.4 - flash memory configuration the default memory configuration of the st10f280 memory is determined by the state of the ea pin at reset. this value is stored in the internal rom enable bit (named romen) of the syscon register. when romen = 0, the internal flash is disabled and external rom is used for startup control. flash memory can later be enabled by setting the romen bit of syscon to 1. the code performing this setting must not run from a segment of the external rom to be replaced by a segment of the flash memory, otherwise unexpected behaviour may occur. for example, if external rom code is located in the first 32k bytes of segment 0, the first 32k bytes of the flash must then be enabled in segment 1. this is done by setting the roms1 bit of syscon to 0 before or simultaneously with setting of romen bit. this must be done in the externally supplied program before the execution of the einit instruction. if program execution starts from external memory, but access to the flash memory mapped in segment 0 is later required, then the code that performs the setting of romen bit must be executed either in the segment 0 but above address 008000h, or from the internal ram. bit roms1 only affects the mapping of the first 32k bytes of the flash memory. all other parts of the flash memory (addresses 018000h 08ffffh) remain unaffected. the sgtdis segmentation disable / enable must also be set to 0 to allow the use of the full 512k bytes of on-chip memory in addition to the external boot memory. the correct procedure on changing the segmentation registers must also be observed to prevent an unwanted trap condition: C instructions that configure the internal memory must only be executed from external memory or from the internal ram. C an absolute inter-segment jump (jmps) instruction must be executed after flash enabling, to the next instruction, even if this next instruction is located in the consecutive address. C whenever the internal memory is disabled, enabled or remapped, the dpps must be explicitly (re)loaded to enable correct data accesses to the internal memory and/or external memory. 5.5 - application examples 5.5.1 - handling of flash addresses all command, block, data and register addresses to the flash have to be located within the active flash memory space. the active space is that address range to which the physical flash addresses are mapped as defined by the user. when using data page pointer (dpp) for block addresses make sure that address bit a15 and a14 of the block address are reflected in both lsbs of the selected dpps. note: - for command instructions, address bit a14, a15, a16, a17 and a18 are dont care. this simplify a lot the application software, because it minimize the use of dpp registers when using command in the command interface. - direct addressing is not allowed for command sequence operations to the flash. only register-indirect addressing can be used for command, block or write-data accesses.
st10f280 30/186 5.5.2 - basic flash access control when accessing the flash all command write addresses have to be located within the active flash memory space. the active flash memory space is that logical address range which is covered by the flash after mapping. when using data page pointer (dpp) for addressing the flash, make sure that address bit a15 and a14 of the command addresses are reflected in both lsbs of the selected data page pointer (a15 dppx.1 and a14 dppx.0). in case of the command write addresses, address bit a14, a15 and above are dont care. thus, command writes can be performed by only using one dpp register. this allow to have a more simple and compact application software. another advantageous possibility is to use the extended segment instruction for addressing. note: the direct addressing mode is not allowed for write access to the flash address/command register. be aware that the c compiler may use this kind of addressing. for write accesses to flash module always the indirect addressing mode has to be selected. the following basic instruction sequences show examples for different addressing possibilities. principle example of address generation for flash commands and registers: when using data page pointer (dpp0 is this example) mov dpp0,#08h ;adjust data page pointers according to the ;addresses: dpp0 is used in this example, thus ;address must have a14 and a15 bit set to 0. mov rw m ,#address ;address could be a dedicated command sequence ;address 2aa8h, 1554h ... ) or the flash write ;address mov rw n ,#data ;data could be a dedicated command sequence data ;(xxa0h,xx80h ... ) or data to be programmed mov [rw m ],rw n ; indirect addressing when using the extended segment instruction: mov rw m ,#address ;address could be a dedicated command sequence ;address (2aa8h, 1554h ... ) or the flash write ;address mov rw o ,#data ;data could be a dedicated command sequence data ;(xxa0h,xx80h ... ) or data to be programmed mov rw n ,#segment ;the value of segment represents the segment ;number and could be 0, 1, 2, 3 or 4 (depending ;on sector mapping) for 256kbyte flash. exts rw n ,#length ;the value of rwn determines the 8-bit segment ;valid for the corresponding data access for any ;long or indirect address in the following(s) ;instruction(s). length defines the number of ;the effected instruction(s) and has to be a value ;between 1...4 mov [rw m ],rw o ; indirect addressing with segment number from ;exts
st10f280 31/186 5.5.3 - programming examples most of the microcontroller programs are written in the c language where the data page pointers are automatically set by the compiler. but because the c compiler may use the not allowed direct addressing mode for flash write addresses, it is necessary to program the organisational flash accesses (command sequences) with assembler in-line routines which use indirect addressing. example 1 performing the command read/reset we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1. according to the usual way of st10 data addressing with data page pointers, address bit a15 and a14 of a 16-bit command write address select the data page pointer (dpp) which contains the upper 10-bit for building the 24-bit physical data address. address bit a13...a0 represent the address offset. as the bit a14...a18 are "dont care" when written a flash command in the command interface (ci), we can choose the most conveniant dppx register for address handling. the following examples are making usage of dpp0. we just have to make sure, that dpp0 points to active flash memory space. to be independent of mapping of sector 0 we choose for all dpps which are used for flash address handling, to point to segment 2. for this reason we load dpp0 with value 08h (00 0000 l000b). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) scxt dppo, #08h ;push data page pointer 0 and load it to point to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #0f0h ;load register r7 with read/reset command mov [r5], r7 ;command cycle 3. address is dont care pop dpp0 ;restore dpp0 value in the example above the 16-bit registers r5 and r6 are used as auxilary registers for indirect addressing. example 2 performing a program word command we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1.the data to be written is loaded in register r13, the address to be programmed is loaded in register r11/r12 (segment number in r11, segment offset in r12). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) sxct dppo, #08h ;push data page pointer 0 and load it to point to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #0a0h ;load register r7 with program word command mov [r5], r7 ;command cycle 3
st10f280 32/186 pop dpp0 ;restore dpp0: following addressing to the flash ;will use extended instructions ;r11 contains the segment to be programmed ;r12 contains the segment offset address to be ;programmed ;r13 contains the data to be programmed exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r13 ;command cycle 4: the epc starts execution of ;programming command data_polling: exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 mov r6, r7 ;save it in r6 register ;check if fsb.7 = data.7 (i.e. r7.7 = r13.7) xor r7, r13 jnb r7.7, prog_ok ;check if fsb.5 = 1 (programming error) jnb r6.5, data_polling ;programming error: verify is flash programmed ;data is ok exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 ;check if fsb.7 = data.7 xor r7, r13 jnb r7.7, prog_ok ;programming failed: flash remains in write ;operation. ;to go back to normal read operations, a read/reset ;command ;must be performed prog_error: mov r7, #0f0h ;load register r7 with read/reset command exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;address is dont care for read/reset command ... ;here place specific error handling code ... ... ;when programming operation finished succesfully, ;flash is set back automatically to normal read mode prog_ok: .... ....
st10f280 33/186 example 3 performing the block erase command we assume that in the initialization phase the lowest 32k bytes of flash memory (sector 0) have been mapped to segment 1.the registers r11/r12 contain an address related to the block to be erased (segment number in r11, segment offset in r12, for example r11 = 01h, r12= 4000h will erase the block 1 first 8k byte block). mov r5, #01554h ;load auxilary register r5 with command address ;(used in command cycle 1) mov r6, #02aa8h ;load auxilary register r6 with command address ;(used in command cycle 2) sxct dppo, #08h ;push data page pointer 0 and load it to point ;to ;segment 2 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 1 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 2 mov r7, #080h ;load register r7 with block erase command mov [r5], r7 ;command cycle 3 mov r7, #0a8h ;load register r7 with 1st ci enable command mov [r5], r7 ;command cycle 4 mov r7, #054h ;load register r7 with 2cd ci enable command mov [r6], r7 ;command cycle 5 pop dpp0 ;restore dpp0: following addressing to the flash ;will use extended instructions ;r11 contains the segment of the block to be erased ;r12 contains the segment offset address of the ;block to be erased mov r7, #030h ;load register r7 with erase confirm code exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;command cycle 6: the epc starts execution of ;erasing command erase_polling: exts r11, #1 ;use extended addressing for next mov instruction mov r7, [r12] ;read flash status register (fsb) in r7 ;check if fsb.7 = 1 (i.e. r7.7 = 1) jb r7.7, erase_ok ;check if fsb.5 = 1 (erasing error) jnb r7.5, erase_polling ;programming failed: flash remains in write ;operation. ;to go back to normal read operations, a read/reset ;command ;must be performed erase_error: mov r7, #0f0h ;load register r7 with read/reset command exts r11, #1 ;use extended addressing for next mov instruction mov [r12], r7 ;address is dont care for read/reset command ... ;here place specific error handling code ... ... ;when erasing operation finished succesfully, ;flash is set back automatically to normal read mode erase_ok: .... ....
st10f280 34/186 5.6 - bootstrap loader the built-in bootstrap loader (bsl) of the st10f280 provides a mechanism to load the startup program through the serial interface after reset. in this case, no external memory or internal flash memory is required for the initialization code starting at location 000000h (see figure 5). the bootstrap loader moves code/data into the internal ram, but can also transfer data via the serial interface into an external ram using a second level loader routine. rom memory (internal or external) is not necessary, but it may be used to provide lookup tables or core-code like a set of general purpose subroutines for i/o operations, number crunching, system initialization, etc. the bootstrap loader can be used to load the complete application software into romless systems, to load temporary software into complete systems for testing or calibration, or to load a programming routine for flash devices. the bsl mechanism can be used for standard system startup as well as for special occasions like system maintenance (firmer update) or end-of-line programming or testing. 5.6.1 - entering the bootstrap loader the st10f280 enters bsl mode when pin p0l.4 is sampled low at the end of a hardware reset. in this case the built-in bootstrap loader is activated independent of the selected bus mode. the bootstrap loader code is stored in a special boot-rom. no part of the standard mask memory or flash memory area is required for this. after entering bsl mode and the respective initialization the st10f280 scans the rxd0 line to receive a zero byte, one start bit, eight 0 data bits and one stop bit. from the duration of this zero byte it calculates the corresponding baud rate factor with respect to the current cpu clock, initializes the serial interface asc0 accordingly and switches pin txd0 to output. using this baud rate, an identification byte is returned to the host that provides the loaded data. this identification byte identifies the device to be booted. identification byte is d5h for the st10f280. figure 5 : bootstrap loader sequence rstin txd0 internal boot memory (bsl) routine 32 byte user software 2) 3) rxd0 csp:ip 4) 6) p0l.4 1) bsl initialization time 2) zero byte (1 start bit, eight ?0? data bits, 1 stop bit), sent by host. 3) identification byte (d5h), sent by st10f280. 4) 32 bytes of code / data, sent by host. 5) caution: txd0 is only driven a certain time after reception of the zero byte. 6) internal boot rom. 1) 5)
st10f280 35/186 when the st10f280 has entered bsl mode, the following configuration is automatically set (values that deviate from the normal reset values, are marked ): in this case, the watchdog timer is disabled, so the bootstrap loading sequence is not time limited. pin txd0 is configured as output, so the st10f280 can return the identification byte. even if the internal flash is enabled, no code can be executed out of it. the hardware that activates the bsl during reset may be a simple pull-down resistor on p0l.4 for systems that use this feature upon every hardware reset. a switchable solution (via jumper or an external signal) can be used for systems that only temporarily use the bootstrap loader (see figure 6). after sending the identification byte the asc0 receiver is enabled and is ready to receive the initial 32 bytes from the host. a half duplex connection is therefore sufficient to feed the bsl. 5.6.2 - memory configuration after reset the configuration (and the accessibility) of the st10f280s memory areas after reset in bootstrap-loader mode differs from the standard case. pin ea is not evaluated when bsl mode is selected, and accesses to the internal flash area are partly redirected, while the st10f280 is in bsl mode (see figure 7). all code fetches are made from the special boot-rom, while data accesses read from the internal user flash. data accesses will return undefined values on romless devices. the code in the boot-rom is not an invariant feature of the st10f280. user software should not try to execute code from the internal flash area while the bsl mode is still active, as these fetches will be redirected to the boot-rom. the boot-rom will also move to segment 1, when the internal flash area is mapped to segment 1 (see figure 7). watchdog timer: disabled register syscon: 0e00h context pointer cp: fa00h register stkun: fa40h stack pointer sp: fa40h register stkov: fa0ch 0<->c register s0con: 8011h register buscon0: acc. to startup configuration register s0bg: acc. to 00 byte p3.10 / txd0: 1 dp3.10: 1 figure 6 : hardware provisions to activate the bsl r pol.4 8k w circuit 1 pol.4 pol.4 normal boot bsl external signal r pol.4 8k w circuit 2
st10f280 36/186 figure 7 : memory configuration after reset 5.6.3 - loading the startup code after sending the identification byte the bsl enters a loop to receive 32 bytes via asc0. these byte are stored sequentially into locations 00fa40h through 00fa5fh of the internal ram. so up to 16 instructions may be placed into the ram area. to execute the loaded code the bsl then jumps to location 00fa40h, which is the first loaded instruction. the bootstrap loading sequence is now terminated, the st10f280 remains in bsl mode, however. most probably the initially loaded routine will load additional code or data, as an average application is likely to require substantially more than 16 instructions. this second receive loop may directly use the pre-initialized interface asc0 to receive data and store it to arbitrary user-defined locations. this second level of loaded code may be the final application code. it may also be another, more sophisticated, loader routine that adds a transmission protocol to enhance the integrity of the loaded code or data. it may also contain a code sequence to change the system configuration and enable the bus interface to store the received data into external memory. this process may go through several iterations or may directly execute the final application. in all cases the st10f280 will still run in bsl mode, that means with the watchdog timer disabled and limited access to the internal flash area. all code fetches from the internal flash area (000000h...007fffh or 010000h...017fffh, if mapped to segment 1) are redirected to the special boot-rom. data fetches access will access the internal boot-rom of the st10f280, if any is available, but will return undefined data on romless devices. 5.6.4 - exiting bootstrap loader mode in order to execute a program in normal mode, the bsl mode must be terminated first. the st10f280 exits bsl mode upon a software reset (ignores the level on p0l.4) or a hardware reset (p0l.4 must be high). after a reset the st10f280 will start executing from location 000000h of the internal flash or the external memory, as programmed via pin ea . 16 mbytes 16 mbytes 16 mbytes bsl mode active yes (p0l.4=0) yes (p0l.4=0) no (p0l.4=1) ea pin high low access to application code fetch from internal flash area test-flash access test-flash access user flash access data fetch from internal flash area user flash access user flash access user flash access iram 1 0 user flash test flash segment 2 255 access to: external bus disabled internal enabled flash 1 0 user flash test flash segment 2 255 access to: external bus enabled internal enabled flash iram 1 0 user flash segment 2 255 access: depends on reset config ea , port0 depends on reset config ea , port0 iram
st10f280 37/186 5.6.5 - choosing the baud rate for the bsl the calculation of the serial baud rate for asc0 from the length of the first zero byte that is received, allows the operation of the bootstrap loader of the st10f280 with a wide range of baud rates. however, the upper and lower limits have to be kept, in order to insure proper data transfer. the st10f280 uses timer t6 to measure the length of the initial zero byte. the quantization uncertainty of this measurement implies the first deviation from the real baud rate, the next deviation is implied by the computation of the s0brl reload value from the timer contents. the formula below shows the association: for a correct data transfer from the host to the st10f280 the maximum deviation between the internal initialized baud rate for asc0 and the real baud rate of the host should be below 2.5%. the deviation (f b , in percent) between host baud rate and st10f280 baud rate can be calculated via the formula below: note: function (f b ) does not consider the tolerances of oscillators and other devices supporting the serial communication. this baud rate deviation is a nonlinear function depending on the cpu clock and the baud rate of the host. the maxima of the function (f b ) increase with the host baud rate due to the smaller baud rate pre-scaler factors and the implied higher quantization error (see figure 8). the minimum baud rate (b low in the figure 8) is determined by the maximum count capacity of timer t6, when measuring the zero byte, and it depends on the cpu clock. using the maximum t6 count 2 16 in the formula the minimum baud rate can be calculated. the lowest standard baud rate in this case would be 1200 baud. baud rates below b low would cause t6 to overflow. in this case asc0 cannot be initialized properly. the maximum baud rate (b high in the figure 8) is the highest baud rate where the deviation still does not exceed the limit, so all baud rates between b low and b high are below the deviation limit. the maximum standard baud rate that fulfills this requirement is 19200 baud. higher baud rates , however, may be used as long as the actual deviation does not exceed the limit. a certain baud rate (marked i in figure 8) may violate the deviation limit, while an even higher baud rate (marked ii in figure 8) stays very well below it. this depends on the host interface. f cpu 32 s0brl 1 + () ----------------------------------------------- - b st10f280 = s0brl t6 36 C 72 ------------------- - = t6 9 4 -- - f cpu b host ----------------- = , f b b contr b host C b contr -------------------------------------------- 100 = % , f b 2.5 % figure 8 : baud rate deviation between host and st10f280 b low 2.5% f b b high i ii b host
st10f280 38/186 6 - central processing unit (cpu) the cpu includes a 4-stage instruction pipeline, a 16-bit arithmetic and logic unit (alu) and dedi- cated sfrs. additional hardware has been added for a separate multiply and divide unit, a bit-mask generator and a barrel shifter. most of the st10f280s instructions can be exe- cuted in one instruction cycle which requires 50ns at 40mhz cpu clock. for example, shift and rotate instructions are processed in one instruc- tion cycle independent of the number of bits to be shifted. multiple-cycle instructions have been optimized: branches are carried out in 2 cycles, 16 x 16 bit multiplication in 5 cycles and a 32/16 bit division in 10 cycles. the jump cache reduces the execution time of repeatedly performed jumps in a loop, from 2 cycles to 1 cycle. the cpu uses a bank of 16 word registers to run the current context. this bank of general purpose registers (gpr) is physically stored within the on-chip internal ram (iram) area. a context pointer (cp) register determines the base address of the active register bank to be accessed by the cpu. the number of register banks is only restricted by the available internal ram space. for easy parameter passing, a register bank may overlap others. a system stack of up to 1024 bytes is provided as a storage for temporary data. the system stack is allocated in the on-chip ram area, and it is accessed by the cpu via the stack pointer (sp) register. two separate sfrs, stkov and stkun, are implicitly compared against the stack pointer value upon each stack access for the detection of a stack overflow or underflow. figure 9 : cpu block diagram (mac unit not included) 32 internal ram 2k byte general purpose registers r0 r15 mdh mdl barrel-shift mul./div.-hw bit-mask gen. alu 16-bit cp sp stkov stkun exec. unit instr. ptr 4-stage pipeline psw syscon buscon 0 buscon 1 buscon 2 buscon 3 buscon 4 addrsel 1 addrsel 2 addrsel 3 addrsel 4 data pg. ptrs code seg. ptr. cpu 512k byte flash memory 16 16 bank n bank i bank 0
st10f280 39/186 the system configuration register syscon this bit-addressable register provides general system configuration and control functions. the reset value for register syscon depends on the state of the port0 pins during reset. syscon (ff12h / 89h) sfr reset value: 0xx0h notes: 1. these bit are set directly or indirectly according to port0 and ea pin configuration during reset sequence. 2. register syscon cannot be changed after execution of the einit instruction. 6.1 - multiplier-accumulator unit (mac) the mac co-processor is a specialized co-pro- cessor added to the st10 cpu core in order to improve the performances of the st10 family in signal processing algorithms. signal processing needs at least three specialized units operating in parallel to achieve maximum performance : C a multiply-accumulate unit, C an address generation unit, able to feed the mac unit with 2 operands per cycle, C a repeat unit, to execute series of multiply-ac- cumulate instructions. the existing st10 cpu has been modified to include new addressing capabilities which enable the cpu to supply the new co-processor with up to 2 operands per instruction cycle. this new co-processor (so-called mac) contains a fast multiply-accumulate unit and a repeat unit. the co-processor instructions extend the st10 cpu instruction set with multiply, multiply-accu- mulate, 32-bit signed arithmetic operations. a new transfer instruction comov has also been added to take benefit of the new addressing capa- bilities. 1514131211109876543210 stksz rom s1 sgt dis rom en byt dis clk en wr cfg cs cfg pwd cfg owd dis bdr sten xpen visi ble xper- share rw rw rw rw 1 rw 1 rw rw 1 rw rw rw rw rw rw rw bit function xpen 0 1 xbus peripheral enable bit accesses to the on-chip x-peripherals and their functions are disabled the on-chip x-peripherals are enabled and can be accessed. bdrsten 0 1 bidirectional reset enable rstin pin is an input pin only. sw reset or wdt reset have no effect on this pin rstin pin is a bidirectional pin. this pin is pulled low during 1024 tcl during reset sequence. owddis 0 1 oscillator watchdog disable control oscillator watchdog (owd) is enabled. if pll is bypassed, the owd monitors xtal1 activity. if there is no activity on xtal1 for at least 1 m s, the cpu clock is switched automatically to plls base frequency (2 to 10mhz). owd is disabled. if the pll is bypassed, the cpu clock is always driven by xtal1 signal. the pll is turned off to reduce power supply current.. pwdcfg 0 1 power down mode configuration control power down mode can only be entered during pwrdn instruction execution if nmi pin is low, oth- erwise the instruction has no effect. to exit power down mode, an external reset must occurs by asserting the rstin pin. power down mode can only be entered during pwrdn instruction execution if all enabled fast external interrupt exxin pins are in their inactive level. exiting this mode can be done by asserting one enabled exxin pin. cscfg 0 1 chip select configuration control latched chip select lines: csx change 1 tcl after rising edge of ale unlatched chip slect lines : csx change with rising edge of ale
st10f280 40/186 6.1.1 - features 6.1.1.1 - enhanced addressing capabilities C new addressing modes including a double indi- rect addressing mode with pointer post-modifi- cation. C parallel data move : this mechanism allows one operand move during multiply-accumulate in- structions without penalty. C new tranfer instructions costore (for fast ac- cess to the mac sfrs) and comov (for fast memory to memory table transfer). 6.1.1.2 - multiply-accumulate unit C one-cycle execution for all mac operations. C 16 x 16 signed/unsigned parallel multiplier. C 40-bit signed arithmetic unit with automatic sat- uration mode. C 40-bit accumulator. C 8-bit left/right shifter. C full instruction set with multiply and multiply-ac- cumulate, 32-bit signed arithmetic and compare instructions. 6.1.1.3 - program control C repeat unit : allows some mac co-processor in- structions to be repeated up to 8192 times. re- peated instructions may be interrupted. C mac interrupt (class b trap) on mac condition flags. figure 10 : mac unit architecture note: * shared with standard alu. operand 2 operand 1 control unit repeat unit st10 cpu interrupt controller msw mrw mah mal mcw flags mae mux 8-bit left/right shifter mux mux sign extend 16 x 16 concatenation signed/unsigned multiplier 40-bit signed arithmetic unit 0h 0h 08000h 40 16 40 40 32 32 16 40 40 40 40 40 scaler ab 40 gpr pointers * idx0 pointer idx1 pointer qr0 gpr offset register qr1 gpr offset register qx0 idx offset register qx1 idx offset register
st10f280 41/186 6.2 - instruction set summary the table 4 lists the instructions of the st10f280. the various addressing modes, instruction operation, parameters for conditional execution of instructions, opcodes and a detailed description of each instruc- tion can be found in the st10 family programming manual. table 4 : instruction set summary mnemonic description bytes add(b) add word (byte) operands 2 / 4 addc(b) add word (byte) operands with carry 2 / 4 sub(b) subtract word (byte) operands 2 / 4 subc(b) subtract word (byte) operands with carry 2 / 4 mul(u) (un)signed multiply direct gpr by direct gpr (16-16-bit) 2 div(u) (un)signed divide register mdl by direct gpr (16-/16-bit) 2 divl(u) (un)signed long divide reg. md by direct gpr (32-/16-bit) 2 cpl(b) complement direct word (byte) gpr 2 neg(b) negate direct word (byte) gpr 2 and(b) bitwise and, (word/byte operands) 2 / 4 or(b) bitwise or, (word/byte operands) 2 / 4 xor(b) bitwise xor, (word/byte operands) 2 / 4 bclr clear direct bit 2 bset set direct bit 2 bmov(n) move (negated) direct bit to direct bit 4 band, bor, bxor and/or/xor direct bit with direct bit 4 bcmp compare direct bit to direct bit 4 bfldh/l bitwise modify masked high/low byte of bit-addressable direct word memory with immediate data 4 cmp(b) compare word (byte) operands 2 / 4 cmpd1/2 compare word data to gpr and decrement gpr by 1/2 2 / 4 cmpi1/2 compare word data to gpr and increment gpr by 1/2 2 / 4 prior determine number of shift cycles to normalize direct word gpr and store result in direct word gpr 2 shl / shr shift left/right direct word gpr 2 rol / ror rotate left/right direct word gpr 2 ashr arithmetic (sign bit) shift right direct word gpr 2 mov(b) move word (byte) data 2 / 4 movbs move byte operand to word operand with sign extension 2 / 4 movbz move byte operand to word operand with zero extension 2 / 4 jmpa, jmpi, jmpr jump absolute/indirect/relative if condition is met 4 jmps jump absolute to a code segment 4 j(n)b jump relative if direct bit is (not) set 4 jbc jump relative and clear bit if direct bit is set 4
st10f280 42/186 6.3 - mac coprocessor specific instructions the following table gives an overview of the mac instruction set. all the mnemonics are listed with the addressing modes that can be used with each instruction. for each combination of mnemonic and address- ing mode this table indicates if it is repeatable or not new addressing capabilities enable the cpu to supply the mac with up to 2 operands per instruc- tion cycle. mac instructions: multiply, multi- ply-accumulate, 32-bit signed arithmetic operations and the comov transfer instruction have been added to the standard instruction set. full details are provided in the st10 family programming manual. double indirect addressing requires two pointers. any gpr can be used for one pointer, the other pointer is provided by one of two specific sfrs idx0 and idx1. two pairs of offset registers qr0/qr1 and qx0/qx1 are associated with each pointer (gpr or idx i ). the gpr pointer allows access to the entire memory space, but idx i are limited to the internal dual-port ram, except for the comov instruction. jnbs jump relative and set bit if direct bit is not set 4 calla, calli, callr call absolute/indirect/relative subroutine if condition is met 4 calls call absolute subroutine in any code segment 4 pcall push direct word register onto system stack and call absolute subroutine 4 trap call interrupt service routine via immediate trap number 2 push, pop push/pop direct word register onto/from system stack 2 scxt push direct word register onto system stack and update register with word operand 4 ret return from intra-segment subroutine 2 rets return from inter-segment subroutine 2 retp return from intra-segment subroutine and pop direct word register from system stack 2 reti return from interrupt service subroutine 2 srst software reset 4 idle enter idle mode 4 pwrdn enter power down mode (supposes nmi -pin being low) 4 srvwdt service watchdog timer 4 diswdt disable watchdog timer 4 einit signify end-of-initialization on rstout-pin 4 atomic begin atomic sequence 2 extr begin extended register sequence 2 extp(r) begin extended page (and register) sequence 2 / 4 exts(r) begin extended segment (and register) sequence 2 / 4 nop null operation 2 table 4 : instruction set summary mnemonic description bytes
st10f280 43/186 mnemonic addressing modes repeatability comul rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no no no comulu comulus comulsu comul- comulu- comulus- comulsu- comul, rnd comulu, rnd comulus, rnd comulsu, rnd comac rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no ye s ye s comacu comacus comacsu comac- comacu- comacus- comacsu- comac, rnd comacu, rnd comacus, rnd comacsu, rnd comacr comacru comacrus rw n , rw m [idx i ? ], [rw n ? ] rw n , [rw m ? ] no no no comacrsu comacr, rnd comacru, rnd comacrus, rnd comacrsu, rnd conop [rw m ?] ye s [idx i ? ] ye s [idx i ? ], [rw m ?] ye s coneg -no coneg, rnd cornd costore rw n , coreg no [rw n ?] , coreg ye s comov [idx i ? ], [rw m ?] ye s
st10f280 44/186 comacm [idx i ? ], [rw m ?] ye s comacmu comacmus comacmsu comacm- comacmu- comacmus- comacmsu- comacm, rnd comacmu, rnd comacmus, rnd comacmsu, rnd comacmr comacmru comacmrus comacmrsu comacmr, rnd comacmru, rnd comacmrus, rnd comacmrsu, rnd coadd rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no ye s ye s coadd2 cosub cosub2 cosubr cosub2r comax comin coload rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] coload- no coload2 no coload2- no cocmp coshl rw m #data4 [rw m ?] ye s no ye s coshr coashr coashr, rnd coabs - rw n , rw m [idx i ? ], [rw m ?] rw n , [rw m ?] no no no mnemonic addressing modes repeatability
st10f280 45/186 the table 5 shows the various combinations of pointer post-modification for each of these 2 new address- ing modes. in this document the symbols [rw n ? ] and [idx i ? ] refer to these addressing modes. table 5 : pointer post-modification combinations for idxi and rwn symbol mnemonic address pointer operation [idx i ? ] stands for [idx i ] (idx i ) ? (idx i ) (no-op) [idx i + ] (idx i ) ? (idx i ) +2 (i=0,1) [idx i ] (idx i ) ? (idx i )2 (i=0,1) [idx i + qx j ] (idx i ) ? (idx i ) + (qx j ) (i, j =0,1) [idx i qx j ] (idx i ) ? (idx i ) (qx j ) (i, j =0,1) [rw n ? ] stands for [rwn] (rwn) ? (rwn) (no-op) [rwn + ] (rwn) ? (rwn) +2 (n=0-15) [rwn-] (rwn) ? (rwn)2 (k=0-15) [rwn + qr j ] (rwn) ? (rwn) + (qr j ) (n=0-15;j =0,1) [rwn qr j ] (rwn) ? (rwn) (qr j ) (n=0-15; j =0,1) table 6 : mac registers referenced as coreg registers description address in opcode msw mac-unit status word 00000b mah mac-unit accumulator high 00001b mas limited mah /signed 00010b mal mac-unit accumulator low 00100b mcw mac-unit control word 00101b mrw mac-unit repeat word 00110b
st10f280 46/186 7 - external bus controller all of the external memory accesses are per- formed by the on-chip external bus controller. the ebc can be programmed to single chip mode when no external memory is required, or to one of four different external memory access modes: C 16-/18-/20-/24-bit addresses 16-bit data, demul- tiplexed C 16-/18-/20-/24-bit addresses 16-bit data, multi- plexed C 16-/18-/20-/24-bit addresses 8-bit data, multi- plexed C 16-/18-/20-/24-bit addresses 8-bit data, demulti- plexed in demultiplexed bus modes addresses are output on port1 and data is input/output on port0 or p0l, respectively. in the multiplexed bus modes both addresses and data use port0 for input/ output. timing characteristics of the external bus inter- face (memory cycle time, memory tri-state time, length of ale and read write delay) are program- mable giving the choice of a wide range of memo- ries and external peripherals. up to 4 independent address windows may be defined (using register pairs addrselx / bus- conx) to access different resources and bus characteristics. these address windows are arranged hierarchi- cally where buscon4 overrides buscon3 and buscon2 overrides buscon1. all accesses to locations not covered by these 4 address windows are controlled by buscon0. up to 5 external cs signals (4 windows plus default) can be generated in order to save exter- nal glue logic. access to very slow memories is supported by a ready function. a hold /hlda protocol is available for bus arbi- tration which shares external resources with other bus masters. the bus arbitration is enabled by setting bit hlden in register psw. after setting hlden once, pins p6.7...p6.5 (breq , hlda , hold ) are automatically controlled by the ebc. in master mode (default after reset) the hlda pin is an output. by setting bit dp6.7 to1 the slave mode is selected where pin hlda is switched to input. this directly connects the slave controller to another master controller without glue logic. for applications which require less external mem- ory space, the address space can be restricted to 1 mbyte, 256 kbyte or to 64 kbyte. port 4 outputs all 8 address lines if an address space of 16 mbytes is used, otherwise four, two or no address lines. chip select timing can be made programmable. by default (after reset), the csx lines change half a cpu clock cycle after the rising edge of ale. with the cscfg bit set in the syscon register the csx lines change with the rising edge of ale. the active level of the ready pin can be set by bit rdypol in the busconx registers. when the ready function is enabled for a specific address window, each bus cycle within the window must be terminated with the active level defined by bit rdypol in the associated buscon register. 7.1 - programmable chip select timing control the st10f280 allows the user to adjust the posi- tion of the csx lines changes. by default (after reset), the csx lines are changing half a cpu clock cycle (12.5 ns at f cpu = 40mhz) after the ris- ing edge of ale. with the cscfg bit set in the syscon register, the csx lines are changing with the rising edge of ale, thus the csx lines are changing at the same time the address lines are changing. see section 19.2 - system configuration registers for detailled description of syscon register.
st10f280 47/186 figure 11 : chip select delay 7.2 - ready programmable polarity the active level of the ready pin can be selected by software via the rdypol bit in the busconx reg- isters. when the ready function is enabled for a specific address window, each bus cycle within this win- dow must be terminated with the active level defined by this rdypol bit in the associted buscon register. buscon0 (ff0ch / 86h) sfr reset value: 0xx0h buscon1 (ff14h / 8ah) sfr reset value: 0000h buscon2 (ff16h / 8bh) sfr reset value: 0000h 1514131211109876543210 csw en0 csre n0 rdy pol0 rdy en0 - bus act0 ale ctl0 - btyp mtt c0 rwd c0 mctc rw rw rw rw rw rw rw rw rw rw 1514131211109876543210 csw en1 csr en1 rdy pol1 rdy en1 - bus act1 ale ctl1 - btyp mtt c1 rwd c1 mctc rw rw rw rw rw rw rw rw rw rw 1514131211109876543210 csw en2 csr en2 rdy pol2 rdy en2 - bus act2 ale ctl2 - btyp mtt c2 rwd c2 mctc rw rw rw rw rw rw rw rw rw rw normal csx rd address (p1) ale segment (p4) normal demultiplexed bus cycle ale lengthen demultiplexed bus cycle unlatched csx wr read/write delay data data data data bus (p0) bus (p0) read/write delay
st10f280 48/186 buscon3 (ff18h / 8ch) sfr reset value: 0000h buscon4 (ff1ah / 8dh) sfr reset value: 0000h 1514131211109876543210 csw en3 csr en3 rdy pol3 rdy en3 - bus act3 ale ctl3 - btyp mtt c3 rwd c3 mctc rw rw rw rw rw rw rw rw rw rw 1514131211109876543210 csw en4 csr en4 rdy pol4 rdy en4 - bus act4 ale ctl4 - btyp mtt c4 rwd c4 mctc rw rw rw rw rw rw rw rw rw rw bit function rdypolx 0 1 ready active level control the active level on the ready pin is low, bus cycle terminates with a 0 on ready pin, the active level on the ready pin is high, bus cycle terminates with a 1 on ready pin.
st10f280 49/186 8 - interrupt system the interrupt response time for internal program execution is from 125ns to 300ns at 40mhz cpu clock. the st10f280 architecture supports several mechanisms for fast and flexible response to service requests that can be generated from various sources (internal or external) to the microcontroller. any of these interrupt requests can be serviced by the interrupt controller or by the peripheral event controller (pec). in contrast to a standard interrupt service where the current program execution is suspended and a branch to the interrupt vector table is performed, just one cycle is stolen from the current cpu activity to perform a pec service. a pec service implies a single byte or word data transfer between any two memory locations with an additional increment of either the pec source or destination pointer. an individual pec transfer counter is implicitly decremented for each pec service except when performing in the continuous transfer mode. when this counter reaches zero, a standard interrupt is performed to the corresponding source related vector location. pec services are very well suited to perform the transmission or the reception of blocks of data. the st10f280 has 8 pec channels, each of them offers such fast interrupt-driven data transfer capabilities. an interrupt control register which contains an interrupt request flag, an interrupt enable flag and an interrupt priority bitfield is dedicated to each existing interrupt source. thanks to its related register, each source can be programmed to one of sixteen interrupt priority levels. once starting to be processed by the cpu, an interrupt service can only be interrupted by a higher prioritized service request. for the standard interrupt processing, each of the possible interrupt sources has a dedicated vector location. software interrupts are supported by means of the trap instruction in combination with an individual trap (interrupt) number. 8.1 - external interrupts fast external interrupt inputs are provided to service external interrupts with high precision requirements. these fast interrupt inputs feature programmable edge detection (rising edge, falling edge or both edges). fast external interrupts may also have interrupt sources selected from other peripherals; for example the canx controller receive signal (canx_rxd) can be used to interrupt the system. this new function is controlled using the external interrupt source selection register exisel. exisel (f1dah / edh) esfr reset value: 0000h 1514131211109876543210 exi7ss exi6ss exi5ss exi4ss exi3ss exi2ss exi1ss exi0ss rw rw rw rw rw rw rw rw exixss external interrupt x source selection (x=7...0) 00: input from associated port 2 pin. 01: input from alternate source. 10: input from port 2 pin ored with alternate source. 11: input from port 2 pin anded with alternate source. exixss port 2 pin alternate source 0 p2.8 can1_rxd 1 p2.9 can2_rxd 2...7 p2.10...15 not used (zero)
st10f280 50/186 exicon ( f1c0h / e0h ) esfr reset value: 0000h 8.2 - interrupt registers and vectors location list table 7 shows all the available st10f280 interrupt sources and the corresponding hardware-related interrupt flags, vectors, vector locations and trap (interrupt) numbers: 1514131211109876543210 exi7es exi6es exi5es exi4es exi3es exi2es exi1es exi0es rw rw rw rw rw rw rw rw exixes(x=7...0) external interrupt x edge selection field (x=7...0) 0 0: fast external interrupts disabled: standard mode exxin pin not taken in account for entering/exiting power down mode. 0 1: interrupt on positive edge (rising) enter power down mode if exiin = 0, exit if exxin = 1 (referred as high active level) 1 0: interrupt on negative edge (falling) enter power down mode if exiin = 1, exit if exxin = 0 (referred as low active level) 1 1: interrupt on any edge (rising or falling) always enter power down mode, exit if exxin level changed. table 7 : interrupt sources source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number capcom register 0 cc0ir cc0ie cc0int 000040h 10h capcom register 1 cc1ir cc1ie cc1int 000044h 11h capcom register 2 cc2ir cc2ie cc2int 000048h 12h capcom register 3 cc3ir cc3ie cc3int 00004ch 13h capcom register 4 cc4ir cc4ie cc4int 000050h 14h capcom register 5 cc5ir cc5ie cc5int 000054h 15h capcom register 6 cc6ir cc6ie cc6int 000058h 16h capcom register 7 cc7ir cc7ie cc7int 00005ch 17h capcom register 8 cc8ir cc8ie cc8int 000060h 18h capcom register 9 cc9ir cc9ie cc9int 000064h 19h capcom register 10 cc10ir cc10ie cc10int 000068h 1ah capcom register 11 cc11ir cc11ie cc11int 00006ch 1bh capcom register 12 cc12ir cc12ie cc12int 000070h 1ch capcom register 13 cc13ir cc13ie cc13int 000074h 1dh capcom register 14 cc14ir cc14ie cc14int 000078h 1eh capcom register 15 cc15ir cc15ie cc15int 00007ch 1fh capcom register 16 cc16ir cc16ie cc16int 0000c0h 30h capcom register 17 cc17ir cc17ie cc17int 0000c4h 31h capcom register 18 cc18ir cc18ie cc18int 0000c8h 32h capcom register 19 cc19ir cc19ie cc19int 0000cch 33h capcom register 20 cc20ir cc20ie cc20int 0000d0h 34h
st10f280 51/186 capcom register 21 cc21ir cc21ie cc21int 0000d4h 35h capcom register 22 cc22ir cc22ie cc22int 0000d8h 36h capcom register 23 cc23ir cc23ie cc23int 0000dch 37h capcom register 24 cc24ir cc24ie cc24int 0000e0h 38h capcom register 25 cc25ir cc25ie cc25int 0000e4h 39h capcom register 26 cc26ir cc26ie cc26int 0000e8h 3ah capcom register 27 cc27ir cc27ie cc27int 0000ech 3bh capcom register 28 cc28ir cc28ie cc28int 0000f0h 3ch capcom register 29 cc29ir cc29ie cc29int 000110h 44h capcom register 30 cc30ir cc30ie cc30int 000114h 45h capcom register 31 cc31ir cc31ie cc31int 000118h 46h capcom timer 0 t0ir t0ie t0int 000080h 20h capcom timer 1 t1ir t1ie t1int 000084h 21h capcom timer 7 t7ir t7ie t7int 0000f4h 3dh capcom timer 8 t8ir t8ie t8int 0000f8h 3eh gpt1 timer 2 t2ir t2ie t2int 000088h 22h gpt1 timer 3 t3ir t3ie t3int 00008ch 23h gpt1 timer 4 t4ir t4ie t4int 000090h 24h gpt2 timer 5 t5ir t5ie t5int 000094h 25h gpt2 timer 6 t6ir t6ie t6int 000098h 26h gpt2 caprel register crir crie crint 00009ch 27h a/d conversion complete adcir adcie adcint 0000a0h 28h a/d overrun error adeir adeie adeint 0000a4h 29h asc0 transmit s0tir s0tie s0tint 0000a8h 2ah asc0 transmit buffer s0tbir s0tbie s0tbint 00011ch 47h asc0 receive s0rir s0rie s0rint 0000ach 2bh asc0 error s0eir s0eie s0eint 0000b0h 2ch ssc transmit sctir sctie sctint 0000b4h 2dh ssc receive scrir scrie scrint 0000b8h 2eh ssc error sceir sceie sceint 0000bch 2fh pwm channel 0...3 pwmir pwmie pwmint 0000fch 3fh can1 interface xp0ir xp0ie xp0int 000100h 40h can2 interface xp1ir xp1ie xp1int 000104h 41h xpwm xp2ir xp2ie xp2int 000108h 42h pll unlock/owd xp3ir xp3ie xp3int 00010ch 43h table 7 : interrupt sources (continued) source of interrupt or pec service request request flag enable flag interrupt vector vector location trap number
st10f280 52/186 hardware traps are exceptions or error conditions that arise during run-time. they cause immediate non-maskable system reaction similar to a standard interrupt service (branching to a dedicated vector table location). the occurrence of a hardware trap is additionally signified by an individual bit in the trap flag register (tfr). except when another higher prioritized trap service is in progress, a hardware trap will interrupt any other program execution. hardware trap services cannot not be interrupted by standard interrupt or by pec interrupts. 8.3 - interrupt control registers all interrupt control registers are identically organized. the lower 8 bit of an interrupt control register contain the complete interrupt status information of the associated source, which is required during one round of prioritization, the upper 8 bit of the respective register are reserved. all interrupt control registers are bit-addressable and all bit can be read or written via software. this allows each interrupt source to be programmed or modified with just one instruction. when accessing interrupt control registers through instructions which operate on word data types, their upper 8 bit (15...8) will return zeros, when read, and will discard written data. the layout of the interrupt control registers shown below applies to each xxic register, where xx stands for the mnemonic for the respective source. xxic (yyyyh / zzh) sfr area reset value: - - 00h 1514131211109876543210 -------- xxir xxie ilvl glvl rw rw rw rw bit function glvl group level defines the internal order for simultaneous requests of the same priority. 3: highest group priority 0: lowest group priority ilvl interrupt priority level defines the priority level for the arbitration of requests. fh: highest priority level 0h: lowest priority level xxie interrupt enable control bit (individually enables/disables a specific source) 0: interrupt request is disabled 1: interrupt request is enabled xxir interrupt request flag 0: no request pending 1: this source has raised an interrupt request
st10f280 53/186 8.4 - exception and error traps list table 8 shows all of the possible exceptions or error conditions that can arise during run-time : * - all the class b traps have the same trap number (and vector) and the same lower priority compare to the class a traps and t o the resets. - each class a traps has a dedicated trap number (and vector). they are prioritized in the second priority level. - the resets have the highest priority level and the same trap number. - the psw.ilvl cpu priority is forced to the highest level (15) when these exeptions are serviced. table 8 : exceptions or error conditions that can arise during run-time exception condition trap flag trap vector vector location trap number trap * priority reset functions maximum hardware reset reset 000000h 00h iii software reset reset 000000h 00h iii watchdog timer overflow reset 000000h 00h iii class a hardware traps non-maskable interrupt nmi nmitrap 000008h 02h ii stack overflow stkof stotrap 000010h 04h ii stack underflow stkuf stutrap 000018h 06h ii class b hardware traps undefined opcode undopc btrap 000028h 0ah i protected instruction fault prtflt btrap 000028h 0ah i illegal word operand access illopa btrap 000028h 0ah i illegal instruction access illina btrap 000028h 0ah i illegal external bus access illbus btrap 000028h 0ah i mac trap mactrp btrap 000028h 0ah i minimum reserved [2ch C3ch] [0bh C 0fh] software traps trap instruction any [000000hC 0001fch] in steps of 4h any [00h C 7fh] current cpu priority
st10f280 54/186 9 - capture/compare (capcom) units the st10f280 has two 16 channels capcom units as described in figure 12. these support generation and control of timing sequences on up to 32 channels with a maximum resolution of 200ns at 40mhz cpu clock. the capcom units are typically used to handle high speed i/o tasks such as pulse and waveform generation, pulse width modulation (pmw), digital to analog (d/a) conversion, software timing, or time recording relative to external events. four 16-bit timers (t0/t1, t7/t8) with reload registers provide two independent time bases for the capture/compare register array (see figure 13 and figure 14). the input clock for the timers is programmable to several prescaled values of the internal system clock, or may be derived from an overflow/ underflow of timer t6 in module gpt2. this provides a wide range of variation for the timer period and resolution and allows precise adjustments to application specific requirements. in addition, external count inputs for capcom timers t0 and t7 allow event scheduling for the capture/compare registers relative to external events. each of the two capture/compare register arrays contain 16 dual purpose capture/compare registers, each of which may be individually allocated to either capcom timer t0 or t1 (t7 or t8, respectively), and programmed for capture or compare functions. each of the 32 registers has one associated port pin which serves as an input pin for triggering the capture function, or as an output pin to indicate the occurrence of a compare event. figure 12 shows the basic structure of the two capcom units. note the capcom2 unit provides 16 capture inputs, but only 12 compare outputs. cc24i to cc27i are inputs only. figure 12 : capcom unit block diagram pin tx input control 2 n n = 3...10 gpt2 timer t6 pin txin cpu clock mode control (capture or compare) 16 capture inputs compare outputs pin ty input control 2 n n = 3...10 gpt2 timer t6 over / underflow cpu clock reload register txrel capcom timer tx interrupt request sixteen 16-bit (capture/compare) registers over / underflow capcom timer ty reload register tyrel 16 capture / compare * interrupt requests interrupt request x = 0, 7 y = 1, 8
st10f280 55/186 figure 13 : block diagram of capcom timers t0 and t7 figure 14 : block diagram of capcom timers t1 and t8 note: when an external input signal is connected to the input lines of both t0 and t7, these timers count the input signal synchronously. thus the two timers can be regarded as one timer whose contents can be compared with 32 capture registers. when a capture/compare register has been selected for capture mode, the current contents of the allocated timer will be latched (captured) into the capture/compare register in response to an external event at the port pin which is associated with this register. in addition, a specific interrupt request for this capture/compare register is generated. either a positive, a negative, or both a positive and a negative external signal transition at the pin can be selected as the triggering event. the contents of all registers which have been selected for one of the five compare modes are continuously compared with the contents of the allocated timers. when a match occurs between the timer value and the value in a capture /compare register, specific actions will be taken based on the selected compare mode (see table 9). the input frequencies f tx , for the timer input selector tx, are determined as a function of the cpu clocks. the timer input frequencies, resolution and periods which result from the selected pre-scaler option in txi when using a 40mhz cpu clock are listed in the table 10. the numbers for the timer periods are based on a reload value of 0000h. note that some numbers may be rounded to 3 significant figures. pin x txl cpu clock txr mux gpt2 timer t6 over / underflow edge select txin txl txl txm input control reload register txrel capcom timer tx txir interrupt request x = 0, 7 x txl cpu clock txr mux gpt2 timer t6 over / underflow txm reload register txrel capcom timer tx txir interrupt request x = 1, 8
st10f280 56/186 table 9 : compare modes compare modes function mode 0 interrupt-only compare mode; several compare interrupts per timer period are possible mode 1 pin toggles on each compare match; several compare events per timer period are possible mode 2 interrupt-only compare mode; only one compare interrupt per timer period is generated mode 3 pin set 1 on match; pin reset 0 on compare time overflow; only one compare event per timer period is generated double register mode two registers operate on one pin; pin toggles on each compare match; several compare events per timer period are possible. table 10 : capcom timer input frequencies, resolution and periods f cpu = 40mhz timer input selection txi 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler for f cpu 8 16 32 64 128 256 512 1024 input frequency 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz 39.1khz resolution 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s 25.6s period 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms 1.678s
st10f280 57/186 10 - general purpose timer unit the gpt unit is a flexible multifunctional timer/ counter structure which is used for time related tasks such as event timing and counting, pulse width and duty cycle measurements, pulse generation, or pulse multiplication. the gpt unit contains five 16-bit timers organized into two separate modules gpt1 and gpt2. each timer in each module may operate independently in several different modes, or may be concatenated with another timer of the same module. 10.1 - gpt1 each of the three timers t2, t3, t4 of the gpt1 module can be configured individually for one of four basic modes of operation: timer , gated timer , counter mode and incremental interface mode . in timer mode, the input clock for a timer is derived from the cpu clock, divided by a programmable prescaler. in counter mode, the timer is clocked in reference to external events. pulse width or duty cycle measurement is supported in gated timer mode where the operation of a timer is controlled by the gate level on an external input pin. for these purposes, each timer has one associated port pin (txin) which serves as gate or clock input. table 11 lists the timer input frequencies, resolution and periods for each pre-scaler option at 40mhz cpu clock. this also applies to the gated timer mode of t3 and to the auxiliary timers t2 and t4 in timer and gated timer mode. the count direction (up/down) for each timer is programmable by software or may be altered dynamically by an external signal on a port pin (txeud). in incremental interface mode, the gpt1 timers (t2, t3, t4) can be directly connected to the incremental position sensor signals a and b by their respective inputs txin and txeud. direction and count signals are internally derived from these two input signals so that the contents of the respective timer tx corresponds to the sensor position. the third position sensor signal top0 can be connected to an interrupt input. timer t3 has output toggle latches (txotl) which changes state on each timer over flow / underflow. the state of this latch may be output on port pins (txout) for time out monitoring of external hardware components, or may be used internally to clock timers t2 and t4 for high resolution of long duration measurements. in addition to their basic operating modes, timers t2 and t4 may be configured as reload or capture registers for timer t3. when used as capture or reload registers, timers t2 and t4 are stopped. the contents of timer t3 is captured into t2 or t4 in response to a signal at their associated input pins (txin). timer t3 is reloaded with the contents of t2 or t4 triggered either by an external signal or by a selectable state transition of its toggle latch t3otl. when both t2 and t4 are configured to alternately reload t3 on opposite state transitions of t3otl with the low and high times of a pwm signal, this signal can be constantly generated without software intervention. table 11 : gpt1 timer input frequencies, resolution and periods f cpu = 40mhz timer input selection t2i / t3i / t4i 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler factor 8 16 32 64 128 256 512 1024 input freq 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz 39.1khz resolution 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s 25.6s period maximum 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms 1.678s
st10f280 58/186 figure 15 : block diagram of gpt1 10.2 - gpt2 the gpt2 module provides precise event control and time measurement. it includes two timers (t5, t6) and a capture/reload register (caprel). both timers can be clocked with an input clock which is derived from the cpu clock via a programmable prescaler or with external signals. the count direction (up/down) for each timer is programmable by software or may additionally be altered dynamically by an external signal on a port pin (txeud). concatenation of the timers is supported via the output toggle latch (t6otl) of timer t6 which changes its state on each timer overflow/underflow. the state of this latch may be used to clock timer t5, or it may be output on a port pin (t6out). the overflow / underflow of timer t6 can additionally be used to clock the capcom timers t0 or t1, and to cause a reload from the caprel register. the caprel register may capture the contents of timer t5 based on an external signal transition on the corresponding port pin (capin), and timer t5 may optionally be cleared after the capture procedure. this allows absolute time differences to be measured or pulse multiplication to be performed without software overhead. the capture trigger (timer t5 to caprel) may also be generated upon transitions of gpt1 timer t3 inputs t3in and/or t3eud. this is advantageous when t3 operates in incremental interface mode. table 12 lists the timer input frequencies, resolution and periods for each pre-scaler option at 40mhz cpu clock. this also applies to the gated timer mode of t6 and to the auxiliary timer t5 in timer and gated timer mode. 2 n n=3...10 2 n n=3...10 2 n n=3...10 t2eud t2in cpu clock cpu clock cpu clock t3in t4in t3eud t4eud t2 mode control t3 mode control t4 mode control gpt1 timer t2 gpt1 timer t3 gpt1 timer t4 t3otl reload capture u/d u/d reload capture interrupt request interrupt request interrupt request t3out u/d table 12 : gpt2 timer input frequencies, resolution and period f cpu = 40mhz timer input selection t5i / t6i 000b 001b 010b 011b 100b 101b 110b 111b pre-scaler factor 4 8 16 32 64 128 256 512 input freq 10mhz 5mhz 2.5mhz 1.25mhz 625khz 312.5khz 156.25khz 78.125khz resolution 100ns 200ns 400ns 0.8s 1.6s 3.2s 6.4s 12.8s period maximum 6.55ms 13.1ms 26.2ms 52.4ms 104.8ms 209.7ms 419.4ms 838.9ms
st10f280 59/186 figure 16 : block diagram of gpt2 2 n n=2...9 2 n n=2...9 t5eud t5in cpu clock cpu clock t6in t6eud t5 mode control t6 mode control gpt2 timer t5 gpt2 timer t6 u/d interrupt request u/d gpt2 caprel t60tl toggle ff t6out capin reload interrupt request to capcom timers capture clear interrupt request
st10f280 60/186 11 - pwm module 11.1 - standard pwm module the pulse width modulation module can generate up to four pwm output signals using edge-aligned or centre-aligned pwm. in addition, the pwm module can generate pwm burst signals and single shot outputs. the table 13 shows the pwm frequencies for different resolutions. the level of the output signals is selectable and the pwm module can generate interrupt requests. figure 17 : block diagram of pwm module table 13 : pwm unit frequencies and resolution at 40mhz cpu clock mode 0 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 156.25khz 39.06khz 9.77khz 2.44hz 610.35hz cpu clock/64 1.6 m s 2.44hz 610.35hz 152.58hz 38.15hz 9.54hz mode 1 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 78.12khz 19.53khz 4.88khz 1.22khz 305.17hz cpu clock/64 1.6 m s 1.22khz 305.17hz 76.29hz 19.07hz 4.77hz ppx period register comparator ptx 16-bit up/down counter shadow register pwx pulse width register input run control clock 1 clock 2 comparator * * * up/down/ clear control match output control match write control * user readable / writeable register enable poutx
st10f280 61/186 11.2 - new pwm module : xpwm the new pulse width modulation (xpwm) module of the st10f280 is mapped on the xbus inter- face (address range 00ec00h-00ecffh) and allows the generation of up to 4 independent pwm signals.the xpwm is enabled by setting xpen bit 2 of the syscon register and bit 4 of the new xpercon register. the frequency range of these xpwm signals for a 40mhz cpu clock is from 9.6hz up to 20mhz for edge aligned signals. for center aligned signals the frequency range is 4.8hz up to 10mhz (see detailed description). the minimum values depend on the width (16 bit) and the resolution (clk/1 or clk/64) of the xpwm timers. the maximum values assume that the xpwm output signal changes with every cycle of the respective timer. in a real application the maximum xpwm frequency will depend on the required resolution of the xpwm output signal (see figure 18). the pulse width modulation module consists of 4 independent pwm channels. each channel has a 16-bit up/down counter xptx, a 16-bit period register xppx with a shadow latch, a 16-bit pulse width register xpwx with a shadow latch, two comparators, and the necessary control logic. the operation of all four channels is controlled by two common control registers, xpwmcon0 and xpwmcon1, and the interrupt control and status is handled by one interrupt control register xp2ic, which is also common for all channels (see figure 19). figure 19 : xpwm channel block diagram figure 18 : sfrs and port pins associated with the xpwm module data registers 15 y 14 y 13 y 12 y 11 y 10 y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y xpp0 yyyy y y yyyyyyyyyy xpw0 yyyy y y yyyyyyyyyy xpp1 yyyy y y yyyyyyyyyy xpw1 yyyy y y yyyyyyyyyy xpp2 yyyy y y yyyyyyyyyy xpw2 yyyy y y yyyyyyyyyy xpp3 yyyy y y yyyyyyyyyy xpw3 15 y 14 y 13 y 12 y 11 y 10 y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y xpt0 yyyy y y yyyyyyyyyy xpt1 yyyy y y yyyyyyyyyy xpt2 yyyy y y yyyyyyyyyy xpt3 counter registers 15 y 14 y 13 y 12 y 11 y 10 y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y xpwmcon0 yy - y - - - - yyyyyyyy xpwmcon1 ---- - - ------yyyy xpolar ---- - - - - yyyyyyyy xp2ic e control registers and interrupt control output on dedicated pins xpwm0 xpwm1 xpwm2 xpwm3 xppx xpwx xptx xpwmconx xpolarx xpwm period register x xpwm pulse width register x xpwm counter register x xpwm control register 0/1 xpwm output polarity control register 0/1 xp2ic xpwm interrupt control register y - e this bit has a xpwm function this bit has no xpwh function or is not implemnented this register belongs to esfr area : : : xppx period register comparator xptx 16-bit up/down counter shadow register xpwx pulse width register input run control clock 1 clock 2 comparator * * * up/down/ clear control match output control match write control * user readable / writeable register enable xpoutx
st10f280 62/186 11.2.1 - operating modes the xpwm module provides four different operat- ing modes: C mode 0 standard pwm generation (edge aligned pwm) available on all four channels C mode 1 symmetrical pwm generation (center aligned pwm) available on all four channels C burst mode combines channels 0 and 1 C single shot mode available on channels 2 and 3 note: the output signals of the xpwm module are xored with the outputs of the respective bits of xpolar register. after reset these bits are cleared, so the pwm signals are directly driven to the output pins. by setting the respective bits of xpolar register to 1 the pwm signal may be inverted (xored with 1) before being driven to the output pin. the descriptions below refer to the standard case after reset, i.e. direct driving. 11.2.1.1 - mode 0: standard pwm generation (edge aligned pwm) mode 0 is selected by clearing the respective bit xpmx in register xpwmcon1 to 0. in this mode the timer xptx of the respective xpwm channel is always counting up until it reaches the value in the associated period shadow register. upon the next count pulse the timer is reset to 0000h and continues counting up with subsequent count pulses. the xpwm output signal is switched to high level when the timer contents are equal to or greater than the contents of the pulse width shadow register. the signal is switched back to low level when the respective timer is reset to 0000h, i.e. below the pulse width shadow register. the period of the resulting pwm signal is deter- mined by the value of the respective xppx shadow register plus 1, counted in units of the timer resolution. pwm_period mode0 = [xppx] + 1 the duty cycle of the xpwm output signal is con- trolled by the value in the respective pulse width shadow register. this mechanism allows the selection of duty cycles from 0% to 100% including the boundaries. for a value of 0000h the output will remain at a high level, representing a duty cycle of 100%. for a value higher than the value in the period register the output will remain at a low level, which corresponds to a duty cycle of 0%. the figure 20 illustrates the operation and output waveforms of a xpwm channel in mode 0 for dif- ferent values in the pulse width register. this mode is referred to as edge aligned pwm, because the value in the pulse width (shadow) register only effects the positive edge of the out- put signal. the negative edge is always fixed and related to the clearing of the timer. figure 20 : operation and output waveform in mode 0 7 6 7 6 5 3 4 2 1 0 7 6 5 3 4 2 1 0 1 0 xppx period=7 xptx count value xpwx pulse width=0 xpwx=1 xpwx=2 xpwx=4 xpwx=6 xpwx=7 xpwx=8 latch shadow registers interrupt request lsr lsr duty cycle 100% 87.5% 75% 50% 25% 12.5% 0% lsr
st10f280 63/186 11.2.1.2 - mode 1: symmetrical pwm generation (center aligned pwm) mode 1 is selected by setting the respective bit xpmx in register xpwmcon1 to 1. in this mode the timer xptx of the respective xpwm channel is counting up until it reaches the value in the associated period shadow register. upon the next count pulse the count direction is reversed and the timer starts counting down now with subsequent count pulses until it reaches the value 0000 h . upon the next count pulse the count direction is reversed again and the count cycle is repeated with the following count pulses. the xpwm output signal is switched to a high level when the timer contents are equal to or greater than the contents of the pulse width shadow register while the timer is counting up. the signal is switched back to a low level when the respective timer has counted down to a value below the contents of the pulse width shadow reg- ister. so in mode 1 this pwm value controls both edges of the output signal. note that in mode 1 the period of the pwm signal is twice the period of the timer: pwm_period mode1 = 2 * ([xppx] + 1) the figure below illustrates the operation and out- put waveforms of a xpwm channel in mode 1 for different values in the pulse width register. this mode is referred to as center aligned pwm, because the value in the pulse width (shadow) register effects both edges of the output signal symmetrically. figure 21 : operation and output waveform in mode 1 1 7 6 5 3 4 2 1 0 1 0 xppx period=7 xptx count value xpwx pulse width=0 xpwx=1 xpwx=2 xpwx=4 xpwx=6 xpwx=7 xpwx=8 latch shadow registers interrupt reques change count lsr duty cycle 100% 87.5% 75% 50% 25% 12.5% 0% 0 2 7 6 5 4 3 2 1 direction lsr
st10f280 64/186 11.2.1.3 - burst mode burst mode is selected by setting bit pb01 in reg- ister xpwmcon1 to 1. this mode combines the signals from xpwm channels 0 and 1 onto the port pin of channel 0. the output of channel 0 is replaced with the logical and of channels 0 and 1. the output of channel 1 can still be used at its associated output pin (if enabled). each of the two channels can either operate in mode 0 or 1. note: it is guaranteed by design, that no spurious spikes will occur at the output pin of channel 0 in this mode. the output of the and gate will be transferred to the output pin synchronously to internal clocks. xoring of the pwm signal and the port output latch value is done after the anding of channel 0 and 1. figure 22 : operation and output waveform in burst mode xpp0 period value xpt0 count value channel 0 xpp1 xpt1 channel 0 channel 1 resulting output xpout0
st10f280 65/186 11.2.1.4 - single shot mode single shot mode is selected by setting the respective bit psx in register xpwmcon1 to 1. this mode is available for xpwm channels 2 and 3. in this mode the timer xptx of the respective xpwm channel is started via software and is counting up until it reaches the value in the asso- ciated period shadow register. upon the next count pulse the timer is cleared to 0000h and stopped via hardware, i.e. the respective ptrx bit is cleared. the xpwm output signal is switched to high level when the timer contents are equal to or greater than the contents of the pulse width shadow register. the signal is switched back to low level when the respective timer is cleared, i.e. is below the pulse width shadow register. thus starting a xpwm timer in single shot mode pro- duces one single pulse on the respective port pin, provided that the pulse width value is between 0000h and the period value. in order to generate a further pulse, the timer has to be started again via software by setting bit ptrx (see figure 23). after starting the timer (i.e. ptrx = 1) the output pulse may be modified via software. writing to timer xptx changes the positive and/or negative edge of the output signal, depending on whether the pulse has already started (i.e. the output is high) or not (i.e. the output is still low). this (multi- ple) re-triggering is always possible while the timer is running, i.e. after the pulse has started and before the timer is stopped. loading counter xptx directly with the value in the respective xppx shadow register will abort the current pwm pulse upon the next clock pulse (counter is cleared and stopped by hardware). by setting the period (xppx), the timer start value (xptx) and the pulse width value (xpwx) appro- priately, the pulse width (tw) and the optional pulse delay (td) may be varied in a wide range. figure 23 : operation and output waveform in single shot mode 7 6 5 3 4 2 1 0 xppx period=7 xptx count value xpwx pulse width=4 set ptrx by software ptrx reset by hardware ptx stopped 7 6 5 3 4 2 1 0 set ptrx by software lsr for next pulse 6 5 3 4 2 1 0 xppx period=7 xptx count value xpwx pulse width=4 7 6 5 4 t d retrigger after write pwx value to ptx 1 0 7 6 5 4 t d trigger before pulse has started : write pwx value to ptx; lsr t w t w shortens delay time t d pulse has started :
st10f280 66/186 11.2.2 - xpwm module registers the xpwm module is controlled via two sets of registers. the waveforms are selected by the channel specific registers xptx (timer), xppx (period) and xpwx (pulse width). three common registers control the operating modes and the general functions (xpwmcon0 and xpwmcon1) of the pwm module as well as the interrupt behavior (xp2ic). up/down counters xptx each counter xptx of a pwm channel is clocked either directly by the cpu clock or by the cpu clock divided by 64. bit ptix in register xpwmcon0 selects the respective clock source. a xpwm counter counts up or down (controlled by hardware), while its respective run control bit ptrx is set. a timer is started (ptrx = 1) via software and is stopped (ptrx = 0) either via hardware or software, depending on its operating mode. control bit ptrx enables or disables the clock input of counter xptx rather than controlling the xpwm output signal. note for the register locations please refer to the table 14. table 15 summarizes the xpwm frequencies that result from various combinations of operating mode, counter resolution (input clock) and pulse width resolution. period registers xppx the 16-bit period register xppx of a xpwm chan- nel determines the period of a pwm cycle, i.e. the frequency of the pwm signal. this register is buff- ered with a shadow register. the shadow register is loaded from the respective xppx register at the beginning of every new pwm cycle, or upon a write access to xppx, while the timer is stopped. the cpu accesses the xppx register while the hardware compares the contents of the shadow register with the contents of the associated counter xptx. when a match is found between counter and xppx shadow register, the counter is either reset to 0000h, or the count direction is switched from counting up to counting down, depending on the selected operating mode of that xpwm channel. for the register locations refer to the table 14. pulse width registers xpwx this 16-bit register holds the actual pwm pulse width value which corresponds to the duty cycle of the pwm signal. this register is buffered with a shadow register. the cpu accesses the xpwx register while the hardware compares the con- tents of the shadow register with the contents of the associated counter xptx. the shadow regis- ter is loaded from the respective xpwx register at the beginning of every new pwm cycle, or upon a write access to xpwx, while the timer is stopped.when the counter value is greater than or equal to the shadow register value, the pwm sig- nal is set, otherwise it is reset. the output of the comparators may be described by the boolean formula: pwm output signal = [xptx] 3 [xpwx shadow latch]. this type of comparison allows a flexible control of the pwm signal. for the register locations refer to thetable 14. table 14 : xpwm module channel specific register addresses register address register address xpw0 ec30h xpt0 ec10h xpw1 ec32h xpt1 ec12h xpw2 ec34h xpt2 ec14h xpw3 ec36h xpt3 ec16h these registers are not bit-addressable. xpp0 ec20h xpp1 ec22h xpp2 ec24h xpp3 ec26h table 15 : xpwm frequency mode 0 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 156.25khz 39.06khz 9.77khz 2.44hz 610.35hz cpu clock/64 1.6 m s 2.44hz 610.35hz 152.58hz 38.15hz 9.54hz mode 1 resolution 8-bit 10-bit 12-bit 14-bit 16-bit cpu clock/1 25ns 78.12khz 19.53khz 4.88khz 1.22khz 305.17hz cpu clock/64 1.6 m s 1.22khz 305.17hz 76.29hz 19.07hz 4.77hz
st10f280 67/186 xpwm control registers register xpwmcon0 controls the function of the timers of the four xpwm channels and the channel specific interrupts. having the control bits organized in functional groups allows e.g. to start or stop all 4 xpwm timers simultaneously with one bitfield instruction. note: this register is not bit-addressable. xpwmcon0 (ec00h) reset value: 0000h register xpwmcon1 controls the operating modes and the outputs of the four xpwm channels. the basic operating mode for each channel (standard=edge aligned, or symmetrical=center aligned pwm mode) is selected by the mode bits xpmx. burst mode (channels 0 and 1) and single shot mode (channel 2 or 3) are selected by separate control bits. the output signal of each xpwm channel is individually enabled by bit penx. if the output is not enabled the respective pin can only be used to generate an inter- rupt request. note: this register is not bit-addressable. xpwmcon1 (ec02h) reset value: 0000h 1514131211109876543210 pir3 pir2 pir1 pir0 pie3 pie2 pie1 pie0 pti3 pti2 pti1 pti0 ptr3 ptr2 ptr1 ptr0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function ptrx 0 1 xpwm timer x run control bit timer xptx is disconnected from its input clock timer xptx is running ptix 0 1 xpwm timer x input clock selection timer xptx clocked with clk cpu timerx ptx clocked with clk cpu / 64 piex 0 1 xpwm channel x interrupt enable flag interrupt from channel x disabled interrupt from channel x enabled pirx 0 1 xpwm channel x interrupt request flag no interrupt request from channel x channel x interrupt pending (must be reset via software) 1514131211109876543210 ps3 ps2 - pb01 ---- pm3 pm2 pm1 pm0 pen3 pen2 pen1 pen0 rwrw-rw----rwrwrwrwrwrwrwrw bit function penx 0 1 xpwm channel x output enable bit channel x output signal disabled, generate interrupt only channel x output signal enabled pmx 0 1 xpwm channel x mode control bit channel x operates in mode 0, edge aligned pwm channel x operates in mode 1, center aligned pwm pb01 0 1 xpwm channel 0/1 burst mode control bit channels 0 and 1 work independently in respective standard mode outputs of channels 0 and 1 are anded to xpwm0 in burst mode psx 0 1 xpwm channel x single shot mode control bit channel x works in respective standard mode channel x operates in single shot mode
st10f280 68/186 11.2.3 - interrupt request generation each of the four channels of the xpwm module can generate an individual interrupt request. each of these channel interrupts can activate the common module interrupt, which actually interrupts the cpu. this common module interrupt is controlled by the xpwm module interrupt control register xp2ic( xpe- ripherals 2 control register). the interrupt service routine can determine the active channel interrupt(s) from the channel specific interrupt request flags pirx in register xpwmcon0. the interrupt request flag pirx of a channel is set at the beginning of a new pwm cycle, i.e. upon loading the shadow registers. this indicates that registers xppx and xpwx are now ready to receive a new value. if a channel interrupt is enabled via its respective piex bit, also the common interrupt request flag xp2ir in register xp2ic is set, provided that it is enabled via the common interrupt enable bit xp2ie. note: the channel interrupt request flags (pirx in register xpwmcon0) are not automatically cleared by hardware upon entry into the interrupt service routine, so they must be cleared via software. the module interrupt request flag xp2ir is cleared by hardware upon entry into the service routine, regardless of how many channel interrupts were active. however, it will be set again if during execution of the service routine a new channel interrupt request is generated. xp2ic (f196h / cbh) esfr reset value: - - 00h note: refer to the general interrupt control register description for an explanation of the control fields. 11.2.4 - xpwm output signals the output signals of the four xpwm channels are xpwm3...xpwm0. the output signal of each pwm channel is individually enabled by control bit penx in register xpwmcon1. the xpwm signals are xored with the outputs of the register xpolar(3...0) before being driven to the output pins. this allows driving the xpwm signal directly to the output pin (xpolar.x=0) or driving the inverted xpwm signal (xpolar.x=1). 15141312111098 7 6 543210 -------- xp2ir xp2ie ilvl glvl rw rw rw rw figure 24 : xpwm output signal generation latch xpolar.3 pwm 3 pin xpwm3 latch xpolar.2 pwm 2 pin xpwm2 latch xpolar.1 pwm 1 pin xpwm1 latch xpolar.0 pwm 0 pin xpwm0 & xpwmcon1.pen3 xpwmcon1.pen2 xpwmcon1.pen0 xpwmcon1.pen1 xor xor xor xor xpwmcon1.pb01
st10f280 69/186 11.2.5 - xpolar register (polarity of the xpwm channel) xpolar (ec04h) reset value: 0000h software control of the xpwm outputs in an application the xpwm output signals are generally controlled by the xpwm module. how- ever, it may be necessary to influence the level of the xpwm output pins via software either to ini- tialize the system or to react on some extraordi- nary condition, e.g. a system fault or an emergency. clearing the timer run bit ptrx stops the associ- ated counter and leaves the respective output at its current level. the individual xpwm channel outputs are con- trolled by comparators according to the formula: C pwm output signal = [ptx] 3 [pwx shadow latch]. so whenever software changes registers xptx, the respective output will reflect the condition after the change. loading timer xptx with a value greater than or equal to the value in xpwx imme- diately sets the respective output, a xptx value below the xpwx value clears the respective out- put. note to prevent further pwm pulses from occurring after such a software intervention the respective counter must be stopped first. 1514131211109876543210 ----------- - xpolar.3 xpolar.2 xpolar.1 xpolar.0 rw rw rw rw bit function xpolar.x 0 1 xpolar channel x polarity bit polarity of channel x is normal polarity of channel x is inverted
st10f280 70/186 12 - parallel ports in order to accept or generate single external con- trol signals or parallel data, the st10f280 pro- vides up to 143 parallel i/o lines, organized into two 16-bit i/o port (port 2, xport9), eight 8-bit i/o ports (port0 made of p0h and p0l, port1 made of p1h and p1l, port 4, port 6, port 7, port 8) , one 15-bit i/o port (port 3) and two 16-bit input port (port 5, xport10). these port lines may be used for general purpose input/output, controlled via software, or may be used implicitly by st10f280s integrated periph- erals or the external bus controller. all port lines are bit addressable, and all input/out- put lines are individually (bit-wise) programmable as inputs or outputs via direction registers (except port 5, xport10). the i/o ports are true bidirec- tional ports which are switched to high impedance state when configured as inputs. the output driv- ers of seven i/o ports (2, 3, 4, 6, 7, 8, 9) can be configured (pin by pin) for push/pull operation or open-drain operation via odpx control registers. the output driver of the pads are programmable to adapt the edge characteristics to the application requirement and to improve the emi behaviour. this is possible using the poconx registers for ports p0l, p0h, p1l, p1h, p2, p3, p4, p6, p7, p8. the output driver capabilities of ale, rd and wr control lines are programmable with the dedi- cated bits of pocon20 control register. the input threshold levels are programmable (ttl/cmos) for five ports (2, 3, 4, 7, 8) with the picon register control bits. the logic level of a pin is clocked into the input latch once per state time, regardless whether the port is configured for input or output. a write operation to a port pin configured as an input causes the value to be written into the port output latch, while a read operation returns the latched state of the pin itself. a read-modify-write operation reads the value of the pin, modifies it, and writes it back to the output latch. writing to a pin configured as an output (dpx.y=1) causes the output latch and the pin to have the written value, since the output buffer is enabled. reading this pin returns the value of the output latch. a read-modify-write operation reads the value of the output latch, modifies it, and writes it back to the output latch, thus also modify- ing the level at the pin. note: the new i/o ports (xport9, xport10) are not mapped on the sfr space but on the internal xbus interface . the xport9 and xport10 are enabled by setting xpen bit 2 of the syscon register and bit 3 of the new xpercon register. on the xbus interface, the registers are not bit-address- able.
st10f280 71/186 figure 25 : sfrs associated with the parallel ports data input / output register 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y p0l ---- - - - - yyyyyyyy p0h ---- - - - - yyyyyyyy p1l ---- - - - - yyyyyyyy p1h yyyy y y yyyyyyyyyy p2 y-yy y y yyyyyyyyyy p3 ---- - - - - yyyyyyyy p4 yyyy y y yyyyyyyyyy p5 ---- - - - - yyyyyyyy p6 ---- - - - - yyyyyyyy p7 ---- - - - - yyyyyyyy p8 direction control registers 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y dp0l ---- - - - - yyyyyyyy dp0h ---- - - - - yyyyyyyy dp1l ---- - - - - yyyyyyyy dp1h yyyy y yyyyyyyyyyy dp2 y-yy y yyyyyyyyyyy dp3 ---- - - - - yyyyyyyy dp4 ---- - - - - yyyyyyyy dp6 ---- - - - - yyyyyyyy dp7 ---- - - - - yyyyyyyy dp8 threshold / open drain control 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 y 6 y 5 - 4 y 3 y 2 y 1 y 0 y picon e yyyy y yyyyyyyyyyy odp2 e --y- y yyyyyyyyyyy odp3 e ---- - - --yy------ odp4 e ---- - - - - yyyyyyyy odp6 e ---- - - - - yyyyyyyy odp7 e ---- - - - - yyyyyyyy odp8 e output driver control register 15 - 14 - 13 - 12 - 11 - 10 - 9 - 8 - 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y pocon0l e ---- - - - - yyyyyyyy pocon0h e ---- - - - - yyyyyyyy pocon1l e ---- - - - - yyyyyyyy pocon1h e yyyy y y yyyyyyyyyy pocon2 e y-yy y y yyyyyyyyyy pocon3 e ---- - - - - yyyyyyyy pocon4 e ---- - - - - yyyyyyyy pocon6 e ---- - - - - yyyyyyyy pocon7 e ---- - - - - yyyyyyyy pocon8 e ---- - - - - yyyyyyyy pocon20 e * * rd , wr , ale lines only y : bit has an i/o function - : bit has no i/o dedicated function or is not implemented register belongs to esfr area e: yyyy y yyyyyyyyyyy p5didis picon: p2lin p2hin p3lin p3hin p4lin p7lin p8lin e e e e
st10f280 72/186 figure 26 : xbus registers associated with the parallel ports 12.1 - introduction 12.1.1 - open drain mode in the st10f280 some ports provide open drain control. this make is possible to switch the output driver of a port pin from a push/pull configuration to an open drain configuration. in push/pull mode a port output driver has an upper and a lower tran- sistor, thus it can actively drive the line either to a high or a low level. in open drain mode the upper transistor is always switched off, and the output driver can only actively drive the line to a low level. when writing a 1 to the port latch, the lower tran- sistor is switched off and the output enters a high-impedance state. the high level must then be provided by an external pull-up device. with this feature, it is possible to connect several port pins together to a wired-and configuration, sav- ing external glue logic and/or additional software overhead for enabling/disabling output signals. this feature is implemented for ports p2, p3, p4, p6, p7 and p8 (see respective sections), and is controlled through the respective open drain control registers odpx. these registers allow the individual bit-wise selection of the open drain mode for each port line. if the respective control bit odpx.y is 0 (default after reset), the output driver is in the push/pull mode. if odpx.y is 1, the open drain configuration is selected. note that all odpx registers are located in the esfr space. 15 y 14 y 13 y 12 y 11 y 10 y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y xp9 yyyy y y yyyyyyyyyy xp9set yyyy y y yyyyyyyyyy xp9clr yyyy y y yyyyyyyyyy xp10 yyyy y y yyyyyyyyyy xp10didis ---- - - ---------y xadcmux 15 y 14 y 13 y 12 y 11 y 10 y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y xdp9 yyyy y y yyyyyyyyyy xp9set yyyy y y yyyyyyyyyy xp9clr 15 y 14 y 13 y 12 y 11 y 10 y 9 y 8 y 7 y 6 y 5 y 4 y 3 y 2 y 1 y 0 y xop9 yyyy y y yyyyyyyyyy xop9set yyyy y y yyyyyyyyyy xop9clr figure 27 : output drivers in push/pull mode and in open drain mode pin q push-pull output driver q open drain output driver external pullup pin
st10f280 73/186 12.1.2 - input threshold control the standard inputs of the st10f280 determine the status of input signals according to ttl levels. in order to accept and recognize noisy signals, cmos-like input thresholds can be selected instead of the standard ttl thresholds for all pins of port 2, port 3, port4, port 7 and port 8. these special thresholds are defined above the ttl thresholds and feature a defined hysteresis to prevent the inputs from toggling while the respective input signal level is near the thresholds. the port input control register picon is used to select these thresholds for each byte of the indicated ports, i.e. the 8-bit ports p7 and p8 are controlled by one bit each while ports p2 and p3 are controlled by two bits each. picon (f1c4h / e2h) esfr reset value:-00h all options for individual direction and output mode control are available for each pin, independent of the selected input threshold. the input hysteresis provides stable inputs from noisy or slowly changing exter- nal signals. 12.1.3 - output driver control the port output control registers poconx allow to select the port output driver characteristics of a port. the aim of these selections is to adapt the output drivers to the applications requirements, and to improve the emi behaviour of the device. two characteristics may be selected: edge characteristic defines the rise/fall time for the respective output, ie. the transition time. slow edge reduce the peak currents that are sinked/sourced when changing the voltage level of an external capaci- tive load. for a bus interface or pins that are changing at frequency higher than 1mhz, however, fast edges may still be required. driver characteristic defines either the general driving capability of the respective driver, or if the driver strength is reduced after the target output level has been reached or not. reducing the driver strength increases the outputs internal resistance, which attenuates noise that is imported via the output line. for driving leds or power transistors, however, a stable high output current may still be required. 1514131211109876543210 -------- p8lin p7lin - p4lin p3hin p3lin p2hin p2lin rw rw rw rw rw rw rw rw bit function pxlin 0 1 port x low byte input level selection pins px.7...px.0 switch on standard ttl input levels pins px.7...px.0 switch on special threshold input levels pxhin 0 1 port x high byte input level selection pins px.15...px.8 switch on standard ttl input levels pins px.15...px.8 switch on special threshold input levels figure 28 : hysteresis for special input thresholds input level bit state hysteresis
st10f280 74/186 for each feature, a 2-bit control field (ie. 4 bits) is provided for each group of 4 port pads (ie. a port nibble), in port output control registers poconx. poconx (f0yyh / zzh) for 8-bit ports esfr reset value: - - 00h poconx (f0yyh / zzh) for 16-bit ports esfr reset value: 0000h note: in case of reading an 8 bit p0conx register, high byte ( bit 15..8) is read as 00h. port control register allocation the table below lists the defined pocon registers and the allocation of control bitfields and port pins: 1514131211109876543210 -------- p n1dc pn1ec pn0dc pn0ec rw rw rw rw 1514131211109876543210 pn3dc pn3ec pn2dc pn2ec pn1dc pn1ec pn0dc pn0ec rw rw rw rw rw rw rw rw bit function pnxec 00 01 10 11 port nibble x edge characteristic (rise/fall time) fast edge mode, rise/fall times depend on the drivers dimensioning. slow edge mode, rise/fall times ~60 ns reserved reserved pnxdc 00 01 10 11 port nibble x driver characteristic (output current) high current mode: driver always operates with maximum strength. dynamic current mode: driver strength is reduced after the target level has been reached. low current mode: driver always operates with reduced strength. reserved control register physical address 8-bit address controlled port pocon0l f080h 40h p0l.7...4 p0l.3...0 pocon0h f082h 41h p0h.7...4 p0h.3...0 pocon1l f084h 42h p1l.7...4 p1l.3...0 pocon1h f086h 43h p1h.7...4 p1h.3...0 pocon2 f088h 44h p2.15...12 p2.11...8 p2.7...4 p2.3...0 pocon3 f08ah 45h p3.15, p3.13...12 p3.11...8 p3.7...4 p3.3...0 pocon4 f08ch 46h p4.7...4 p4.3...0 pocon6 f08eh 47h p6.7...4 p6.3...0 pocon7 f090h 48h p7.7...4 p7.3...0 pocon8 f092h 49h p8.7...4 p8.3...0
st10f280 75/186 dedicated pins output control programmable pad drivers also are supported for the dedicated pins ale, rd and wr . for these pads, a special pocon20 register is provided. pocon20 (f0aah / 5h) esfr reset value: 0000h 12.1.4 - alternate port functions each port line has one associated programmable alternate input or output function. port0 and port1 may be used as the address and data lines when accessing external memory. port 4 outputs the additional segment address bits a23/a19/a18/a16 in systems where more than 64 kbytes of memory are to be accessed directly. port 6 provides the optional chip select outputs and the bus arbitration lines. port 2, port 7 and port 8 are associated with the capture inputs or compare outputs of the capcom units and/or with the outputs of the pwm module. port 2 is also used for fast external interrupt inputs and for timer 7 input. port 3 includes alternate input/output functions of timers, serial interfaces, the optional bus control signal bhe /wrh and the system clock output (clkout). port 5 is used for the analog input channels to the a/d converter or timer control signals. if an alternate output function of a pin is to be used, the direction of this pin must be pro- grammed for output (dpx.y=1), except for some signals that are used directly after reset and are configured automatically. otherwise the pin remains in the high-impedance state and is not effected by the alternate output function. the respective port latch should hold a 1, because its output is anded with the alternate output data (except for pwm output signals). if an alternate input function of a pin is used, the direction of the pin must be programmed for input (dpx.y=0) if an external device is driving the pin. the input direction is the default after reset. if no external device is connected to the pin, however, one can also set the direction for this pin to output. in this case, the pin reflects the state of the port output latch. thus, the alternate input function reads the value stored in the port output latch. this can be used for testing purposes to allow a software trigger of an alternate input function by writing to the port output latch. 1514131211109876543210 -------- p n1dc pn1ec pn0dc pn0ec rw rw rw rw bit function pn0ec 00 01 10 11 rd , wr edge characteristic (rise/fall time) fast edge mode, rise/fall times depend on the drivers dimensioning. slow edge mode, rise/fall times ~60 ns reserved reserved pn0dc 00 01 10 11 rd , wr driver characteristic (output current) high current mode:driver always operates with maximum strength. dynamic current mode:driver strength is reduced after the target level has been reached. low current mode:driver always operates with reduced strength. reserved pn1ec 00 01 10 11 ale edge characteristic (rise/fall time) fast edge mode, rise/fall times depend on the drivers dimensioning. slow edge mode, rise/fall times ~60 ns reserved reserved pn1dc 00 01 10 11 ale driver characteristic (output current) high current mode:driver always operates with maximum strength. dynamic current mode:driver strength is reduced after the target level has been reached. low current mode:driver always operates with reduced strength. reserved
st10f280 76/186 on most of the port lines, the user software is responsible for setting the proper direction when using an alternate input or output function of a pin. this is done by setting or clearing the direction control bit dpx.y of the pin before enabling the alternate function. there are port lines, however, where the direction of the port line is switched automatically. for instance, in the multiplexed external bus modes of port0, the direction must be switched several times for an instruction fetch in order to output the addresses and to input the data. obviously, this cannot be done through instructions. in these cases, the direction of the port line is switched automatically by hardware if the alternate function of such a pin is enabled. to determine the appropriate level of the port output latches check how the alternate data output is com- bined with the respective port latch output. there is one basic structure for all port lines with only an alternate input function. port lines with only an alternate output function, however, have different structures due to the way the direction of the pin is switched and depending on whether the pin is accessible by the user software or not in the alternate func- tion mode. all port lines that are not used for these alternate functions may be used as general purpose i/o lines. when using port pins for general purpose output, the initial output value should be written to the port latch prior to enabling the output drivers, in order to avoid undesired transitions on the output pins. this applies to single pins as well as to pin groups (see examples below). single_bit: bset p4.7 ; initial output level is "high" bset dp4.7 ; switch on the output driver bit_group: bfldh p4, #24h, #24h ; initial output level is "high" bfldh dp4, #24h, #24h ; switch on the output drivers note: when using several bset pairs to control more pins of one port, these pairs must be separated by instructions, which do not reference the respective port (see particular pipeline effects in chap- ter 6 - central processing unit (cpu)). 12.2 - port0 the two 8-bit ports p0h and p0l represent the higher and lower part of port0, respectively. both halves of port0 can be written (e.g. via a pec transfer) without effecting the other half. if this port is used for general purpose i/o, the direction of each line can be configured via the correspond- ing direction registers dp0h and dp0l. p0l (ff00h / 80h) sfr reset value: - - 00h p0h (ff02h / 81h) sfr reset value: - - 00h dp0l (f100h / 80h) esfr reset value: - - 00h 1514131211109876543210 -------- p0l.7 p0l.6 p0l.5 p0l.4 p0l.3 p0l.2 p0l.1 p0l.0 rw rw rw rw rw rw rw rw 1514131211109876543210 -------- p0h.7 p0h.6 p0h.5 p0h.4 p0h.3 p0h.2 p0h.1 p0h.0 rw rw rw rw rw rw rw rw bit function p0x.y port data register p0h or p0l bit y 1514131211109876543210 - - - - - - - - dp0l.7 dp0l.6 dp0l.5 dp0l.4 dp0l.3 dp0l.2 dp0l.1 dp0l.0 rw rw rw rw rw rw rw rw
st10f280 77/186 dp0h (f102h / 81h) esfr reset value: - - 00h 12.2.1 - alternate functions of port0 when an external bus is enabled, port0 is used as data bus or address/data bus. note that an external 8-bit de-multiplexed bus only uses p0l, while p0h is free for i/o (provided that no other bus mode is enabled). port0 is also used to select the system start-up configuration. during reset, port0 is configured to input, and each line is held high through an internal pull-up device. each line can now be indi- vidually pulled to a low level (see dc-level specifi- cations) through an external pull-down device. a default configuration is selected when the respec- tive port0 lines are at a high level. through pull- ing individual lines to a low level, this default can be changed according to the needs of the applica- tions. the internal pull-up devices are designed such that an external pull-down resistors can be used to apply a correct low level. these external pull-down resistors can remain connected to the port0 pins also during normal operation, however, care has to be taken such that they do not disturb the normal function of port0 (this might be the case, for example, if the external resistor is too strong). with the end of reset, the selected bus configuration will be written to the buscon0 register. the configu- ration of the high byte of port0, will be copied into the special register rp0h. this read-only reg- ister holds the selection for the number of chip selects and segment addresses. software can read this register in order to react according to the selected configuration, if required. when the reset is terminated, the internal pull-up devices are switched off, and port0 will be switched to the appropriate operating mode. during external accesses in multiplexed bus modes port0 first outputs the 16-bit intra-seg- ment address as an alternate output function. port0 is then switched to high-impedance input mode to read the incoming instruction or data. in 8-bit data bus mode, two memory cycles are required for word accesses, the first for the low byte and the second for the high byte of the word. during write cycles port0 outputs the data byte or word after outputting the address. during exter- nal accesses in de-multiplexed bus modes port0 reads the incoming instruction or data word or outputs the data byte or word. 1514131211109876543210 - - - - - - - - dp0h.7 dp0h.6 dp0h.5 dp0h.4 dp0h.3 dp0h.2 dp0h.1 dp0h.0 rw rw rw rw rw rw rw rw bit function dp0x.y port direction register dp0h or dp0l bit y dp0x.y = 0: port line p0x.y is an input (high-impedance) dp0x.y = 1: port line p0x.y is an output figure 29 : port0 i/o and alternate functions p0h.7 p0h.6 p0h.5 p0h.4 p0h.3 p0h.2 p0h.1 p0h.0 p0l.7 p0l.6 p0l.5 p0l.4 p0l.3 p0l.2 p0l.1 p0l.0 port0 p0h p0l alternate function a) b) c) d) general purpose input/output 8-bit demultiplexed bus 16-bit demultiplexed bus 8-bit multiplexed bus 16-bit multiplexed bus d7 d6 d5 d4 d3 d2 d1 d0 d15 d14 d13 d12 d11 d10 d9 d8 d7 d6 d5 d4 d3 d2 d1 d0 a15 a14 a13 a12 a11 a10 a9 a8 ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0 ad15 ad14 ad13 ad12 ad11 ad10 ad9 ad8 ad7 ad6 ad5 ad4 ad3 ad2 ad1 ad0
st10f280 78/186 when an external bus mode is enabled, the direc- tion of the port pin and the loading of data into the port output latch are controlled by the bus control- ler hardware. the input of the port output latch is disconnected from the internal bus and is switched to the line labeled alternate data output via a multiplexer. the alternate data can be the 16-bit intra-segment address or the 8/16-bit data information. the incoming data on port0 is read on the line alternate data input. while an external bus mode is enabled, the user software should not write to the port output latch, otherwise unpredict- able results may occur. when the external bus modes are disabled, the contents of the direction register last written by the user becomes active. the figure 30 shows the structure of a port0 pin. figure 30 : block diagram of a port0 pin direction latch write dp0h.y / dp0l.y read dp0h.y / dp0l.y port output latch write p0h.y / p0l.y read p0h.y / p0l.y internal bus mux 0 1 mux 0 1 alternate data output mux 0 1 alternate direction input latch p0h.y p0l.y output buffer y = 7...0 alternate function enable port data output cpu clock
st10f280 79/186 12.3 - port1 the two 8-bit ports p1h and p1l represent the higher and lower part of port1, respectively. both halves of port1 can be written (e.g. via a pec transfer) without effecting the other half. if this port is used for general purpose i/o, the direction of each line can be configured via the correspond- ing direction registers dp1h and dp1l. p1l (ff04h / 82h) sfr reset value: - - 00h p1h (ff06h / 83h) sfr reset value: - - 00h dp1l (f104h / 82h) esfr reset value: - - 00h dp1h (f106h / 83h) esfr reset value: - - 00h 12.3.1 - alternate functions of port1 when a de-multiplexed external bus is enabled, port1 is used as address bus. note that de-multiplexed bus modes use port1 as a 16-bit port. otherwise all 16 port lines can be used for general purpose i/o. the upper four pins of port1 (p1h.7...p1h.4) also serve as capture input lines for the capcom2 unit (cc27io...cc24io). as all other capture inputs, the capture input func- tion of pins p1h.7...p1h.4 can also be used as external interrupt inputs (200 ns sample rate at 40mhz cpu clock). during external accesses in de-multiplexed bus modes port1 outputs the 16-bit intra-segment address as an alternate output function. during external accesses in multiplexed bus modes, when no buscon register selects a de-multiplexed bus mode, port1 is not used and is available for general purpose i/o (see figure 31). when an external bus mode is enabled, the direc- tion of the port pin and the loading of data into the port output latch are controlled by the bus control- ler hardware. the input of the port output latch is disconnected from the internal bus and is switched to the line labeled alternate data out- put via a multiplexer. the alternate data is the 16-bit intra-segment address. 1514131211109876543210 -------- p1l.7 p1l.6 p1l.5 p1l.4 p1l.3 p1l.2 p1l.1 p1l.0 rw rw rw rw rw rw rw rw 1514131211109876543210 -------- p1h.7 p1h.6 p1h.5 p1h.4 p1l.3 p1h.2 p1h.1 p1h.0 rw rw rw rw rw rw rw rw bit function p1x.y port data register p1h or p1l bit y 1514131211109876543210 --------d p1l.7 dp1l.6 dp1l.5 dp1l.4 dp1l.3 dp1l.2 dp1l.1 dp1l.0 rw rw rw rw rw rw rw rw 1514131211109876543210 --------d p1h.7 dp1h.6dp1h.5dp1h.4dp1h.3dp1h.2 dp1h.1 dp1h.0 rw rw rw rw rw rw rw rw bit function dp1x.y port direction register dp1h or dp1l bit y dp1x.y = 0: port line p1x.y is an input (high-impedance) dp1x.y = 1: port line p1x.y is an output
st10f280 80/186 while an external bus mode is enabled, the user software should not write to the port output latch, other- wise unpredictable results may occur. when the external bus modes are disabled, the contents of the direction register last written by the user becomes active. the figure below shows the structure of a port1 pin. 12.4 - port 2 if this 16-bit port is used for general purpose i/o, the direction of each line can be configured via the cor- responding direction register dp2. each port line can be switched into push/pull or open drain mode via the open drain control register odp2. figure 31 : port1 i/o and alternate functions figure 32 : block diagram of a port1 pin port1 p1h p1l alternate function a) general purpose input/output 8/16-bit demultiplexed bus b) capcom2 capture inputs p1h.7 p1h.6 p1h.5 p1h.4 p1h.3 p1h.2 p1h.1 p1h.0 p1l.7 p1l.6 p1l.5 p1l.4 p1l.3 p1l.2 p1l.1 p1l.0 a15 a14 a13 a12 a11 a10 a9 a8 a7 a6 a5 a4 a3 a2 a1 a0 cc27i cc26i cc25i cc24i direction latch write dp1h.y / dp1l.y read dp1h.y / dp1l.y port output latch write p1h.y / p1l.y read p1h.y / p1l.y internal bus mux 0 1 mux 0 1 mux 0 1 1 input latch p1h.y p1l.y output buffer y = 7...0 alternate function enable port data output alternate data output cpu clock
st10f280 81/186 p2 (ffc0h / e0h) sfr reset value: 0000h dp2 (ffc2h / e1h) sfr reset value: 0000h odp2 (f1c2h / e1h) esfr reset value: 0000h 12.4.1 - alternate functions of port 2 all port 2 lines (p2.15...p2.0) serve as capture inputs or compare outputs (cc15io...cc0io) for the capcom1 unit. when a port 2 line is used as a capture input, the state of the input latch, which represents the state of the port pin, is directed to the capcom unit via the line alternate pin data input. if an external capture trigger signal is used, the direction of the respective pin must be set to input. if the direction is set to output, the state of the port output latch will be read since the pin represents the state of the output latch. this can be used to trigger a cap- ture event through software by setting or clearing the port latch. note that in the output configura- tion, no external device may drive the pin, other- wise conflicts would occur. when a port 2 line is used as a compare output (compare modes 1 and 3), the compare event (or the timer overflow in compare mode 3) directly effects the port output latch. in compare mode 1, when a valid compare match occurs, the state of the port output latch is read by the capcom con- trol hardware via the line alternate latch data input, inverted, and written back to the latch via the line alternate data output. the port output latch is clocked by the signal compare trigger which is generated by the capcom unit. in compare mode 3, when a match occurs, the value '1' is written to the port output latch via the line alternate data output. when an overflow of the corresponding timer occurs, a '0' is written to the port output latch. in both cases, the output latch is clocked by the signal compare trigger. 1514131211109876543210 p2.15 p2.14 p2.13 p2.12 p2.11 p2.10 p2.9 p2.8 p2.7 p2.6 p2.5 p2.4 p2.3 p2.2 p2.1 p2.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function p2.y port data register p2 bit y 1514131211109876543210 dp2. 15 dp2. 14 dp2. 13 dp2. 12 dp2. 11 dp2. 10 dp2.9 dp2.8 dp2.7 dp2.6 dp2.5 dp2.4 dp2.3 dp2.2 dp2.1 dp2.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function dp2.y port direction register dp2 bit y dp2.y = 0: port line p2.y is an input (high-impedance) dp2.y = 1: port line p2.y is an output 1514131211109876543210 odp2 .15 odp2 .14 odp2 .13 odp2 .12 odp2 .11 odp2 .10 odp2 .9 odp2 .8 odp2 .7 odp2 .6 odp2 .5 odp2 .4 odp2 .3 odp2 .2 odp2 .1 odp2 .0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function odp2.y port 2 open drain control register bit y odp2.y = 0: port line p2.y output driver in push/pull mode odp2.y = 1: port line p2.y output driver in open drain mode
st10f280 82/186 the direction of the pin should be set to output by the user, otherwise the pin will be in the high-impedance state and will not reflect the state of the output latch. as can be seen from the port structure below, the user software always has free access to the port pin even when it is used as a compare output. this is useful for setting up the initial level of the pin when using compare mode 1 or the dou- ble-register mode. in these modes, unlike in com- pare mode 3, the pin is not set to a specific value when a compare match occurs, but is toggled instead. when the user wants to write to the port pin at the same time a compare trigger tries to clock the out- put latch, the write operation of the user software has priority. each time a cpu write access to the port output latch occurs, the input multiplexer of the port output latch is switched to the line con- nected to the internal bus. the port output latch will receive the value from the internal bus and the hardware triggered change will be lost. as all other capture inputs, the capture input func- tion of pins p2.15...p2.0 can also be used as external interrupt inputs (200 ns sample rate at 40mhz cpu clock). the upper eight port 2 lines (p2.15...p2.8) also can serve as fast external interrupt inputs from ex0in to ex7in. (fast external interrupt sampling rate is 25ns at 40mhz cpu clock). p2.15 in addition serves as input for capcom2 timer t7 (t7in). the table below summarizes the alternate func- tions of port 2. figure 33 : port 2 i/o and alternate functions port 2 pin alternate function a) alternate function b) alternate function c) p2.0 p2.1 p2.2 p2.3 p2.4 p2.5 p2.6 p2.7 p2.8 p2.9 p2.10 p2.11 p2.12 p2.13 p2.14 p2.15 cc0io cc1io cc2io cc3io cc4io cc5io cc6io cc7io cc8io cc9io cc10io cc11io cc12io cc13io cc14io cc15io - - - - - - - - ex0in fast external interrupt 0 input ex1in fast external interrupt 1 input ex2in fast external interrupt 2 input ex3in fast external interrupt 3 input ex4in fast external interrupt 4 input ex5in fast external interrupt 5 input ex6in fast external interrupt 6 input ex7in fast external interrupt 7 input - - - - - - - - - - - - - - - t7in timer t7 ext. count input port 2 alternate function a) general purpose input / output capcom1 capture input / compare output b) fast external interrupt input c) capcom2 timer t7 input p2.15 p2.14 p2.13 p2.12 p2.11 p2.10 p2.9 p2.8 p2.7 p2.6 p2.5 p2.4 p2.3 p2.2 p2.1 p2.0 cc15io cc14io cc13io cc12io cc11io cc10io cc9io cc8io cc7io cc6io cc5io cc4io cc3io cc2io cc1io cc0io ex7in ex6in ex5in ex4in ex3in ex2in ex1in ex0in t7in
st10f280 83/186 the pins of port 2 combine internal bus data with alternate data output before the port latch input. figure 34 : block diagram of a port 2 pin open drain latch write odp2.y read odp2.y direction latch write dp2.y read dp2.y internal bus mux 0 1 alternate data input input latch p2.y ccyio output buffer x = 7...0 alternate data output mux 0 1 output latch 3 1 write port p2.y compare trigger read p2.y fast external interrupt input cpu clock exxin y = 15...0
st10f280 84/186 12.5 - port 3 if this 15-bit port is used for general purpose i/o, the direction of each line can be configured by the cor- responding direction register dp3. most port lines can be switched into push/pull or open drain mode by the open drain control register odp3 (pins p3.15, p3.14 and p3.12 do not support open drain mode). due to pin limitations register bit p3.14 is not connected to an output pin. p3 (ffc4h / e2h) sfr reset value: 0000h dp3 (ffc6h / e3h) sfr reset value: 0000h odp3 (f1c6h / e3h) sfr reset value: 0000h 1514131211109876543210 p3.15 - p3.13 p3.12 p3.11 p3.10 p3.9 p3.8 p3.7 p3.6 p3.5 p3.4 p3.3 p3.2 p3.1 p3.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function p3.y port data register p3 bit y 1514131211109876543210 dp3 .15 - dp3 .13 dp3 .12 dp3 .11 dp3 .10 dp3.9 dp3.8 dp3.7 dp3.6 dp3.5 dp3.4 dp3.3 dp3.2 dp3.1 dp3.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function dp3.y port direction register dp3 bit y dp3.y = 0: port line p3.y is an input (high-impedance) dp3.y = 1: port line p3.y is an output 1514131211109876543210 - - odp3 .13 - odp3 .11 odp3 .10 odp3 .9 odp3 .8 odp3 .7 odp3 .6 odp3 .5 odp3 .4 odp3 .3 odp3 .2 odp3 .1 odp3 .0 rw rw rw rw rw rw rw rw rw rw rw rw rw bit function odp3.y port 3 open drain control register bit y odp3.y = 0: port line p3.y output driver in push-pull mode odp3.y = 1: port line p3.y output driver in open drain mode
st10f280 85/186 12.5.1 - alternate functions of port 3 the pins of port 3 serve for various functions which include external timer control lines, the two serial interfaces and the control lines bhe /wrh and clkout. the port structure of the port 3 pins depends on their alternate function (see figure 36). when the on-chip peripheral associated with a port 3 pin is configured to use the alternate input function, it reads the input latch, which represents the state of the pin, via the line labeled alternate data input. port 3 pins with alternate input func- tions are: t0in, t2in, t3in, t4in, t3eud and capin. when the on-chip peripheral associated with a port 3 pin is configured to use the alternate output function, its alternate data output line is anded with the port output latch line. when using these alternate functions, the user must set the direction of the port line to output (dp3.y=1) and must set the port output latch (p3.y=1). otherwise the pin is in its high-impedance state (when configured as input) or the pin is stuck at '0' (when the port out- put latch is cleared). when the alternate output functions are not used, the alternate data output line is in its inactive state, which is a high level ('1'). port 3 pins with alternate output functions are: t6out, t3out, txd0 and clkout. table 16 : port 3 alternative functions port 3 pin alternate function p3.0 p3.1 p3.2 p3.3 p3.4 p3.5 p3.6 p3.7 p3.8 p3.9 p3.10 p3.11 p3.12 p3.13 p3.14 p3.15 t0in capcom1 timer 0 count input t6out timer 6 toggle output capin gpt2 capture input t3out timer 3 toggle output t3eud timer 3 external up/down input t4in timer 4 count input t3in timer 3 count input t2in timer 2 count input mrst ssc master receive / slave transmit mtsr ssc master transmit / slave receive txd0 asc0 transmit data output rxd0 asc0 receive data input / (output in synchronous mode) bhe /wrh byte high enable / write high output sclk ssc shift clock input/output --- no pin assigned! clkout system clock output figure 35 : port 3 i/o and alternate functions port 3 no pin alternate function a) b) general purpose input/output p3.15 p3.13 p3.12 p3.11 p3.10 p3.9 p3.8 p3.7 p3.6 p3.5 p3.4 p3.3 p3.2 p3.1 p3.0 clkout sclk bhe rxd0 txd0 mtsr mrst t2in t3in t4in t3eud t3out capin t6out t0in wrh
st10f280 86/186 when the on-chip peripheral associated with a port 3 pin is configured to use both the alternate input and output function, the descriptions above apply to the respective current operating mode. the direction must be set accordingly. port 3 pins with alternate input/output functions are: mtsr, mrst, rxd0 and sclk. note: enabling the clkout function automatically enables the p3.15 output driver. setting bit dp3.15=1 is not required. figure 36 : block diagram of port 3 pin with alternate input or alternate output function open drain latch write odp3.y read odp3.y direction latch write dp3.y read dp3.y internal bus mux 0 1 alternate data input input latch p3.y output buffer y = 13, 11...0 port output latch read p3.y write p3.y & alternate data output port data output cpu clock
st10f280 87/186 pin p3.12 (bhe /wrh ) is another pin with an alternate output function, however, its structure is slightly dif- ferent (see figure figure 37). after reset the bhe or wrh function must be used depending on the sys- tem start-up configuration. in either of these cases, there is no possibility to program any port latches before. thus, the appropriate alternate function is selected automatically. if bhe /wrh is not used in the system, this pin can be used for general purpose i/o by disabling the alternate function (bytdis = 1 / wrcfg=0). note: enabling the bhe or wrh function automatically enables the p3.12 output driver. setting bit dp3.12=1 is not required. during bus hold, pin p3.12 is switched back to its standard function and is then controlled by dp3.12 and p3.12. keep dp3.12 = 0 in this case to ensure floating in hold mode. 12.6 - port 4 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corre- sponding direction register dp4. p4 (ffc8h / e4h) sfr reset value: - - 00h figure 37 : block diagram of pins p3.15 (clkout) and p3.12 (bhe /wrh ) 1514131211109876543210 -------- p4.7 p4.6 p4.5 p4.4 p4.3 p4.2 p4.1 p4.0 rw rw rw rw rw rw rw rw bit function p4.y port data register p4 bit y direction latch write dp3.x read dp3.x port output latch write p3.x read p3.x internal bus mux 0 1 mux 0 1 alternate data output mux 0 1 1 input latch p3.12/bhe p3.15/clkout output buffer x = 15, 12 alternate function enable cpu clock
st10f280 88/186 dp4 (ffcah / e5h) sfr reset value: - - 00h for can configuration support (see chapter 15 - can modules), port 4 has a new open drain function, controlled with the new odp4 register: odp4 (f1cah / e5h) sfr reset value: - - 00h note: only bits 6 and 7 are implemented, all other bits will be read as 0. 12.6.1 - alternate functions of port 4 during external bus cycles that use segmentation (i.e. an address space above 64k bytes) a num- ber of port 4 pins may output the segment address lines. the number of pins used for seg- ment address output determines the directly accessible external address space. the other pins of port 4 may be used for general purpose i/o. if segment address lines are selected, the alternate function of port 4 may be necessary to access e.g. external memory directly after reset. for this reason port 4 will be switched to this alternate function automatically. the number of segment address lines is selected via port0 during reset. the selected value can be read from bitfield salsel in register rp0h (read only) to check the configuration during run time. devices with can interfaces use 2 pins of port 4 to interface each can module to an external can transceiver. in this case the number of possible segment address lines is reduced. the table below summarizes the alternate func- tions of port 4 depending on the number of selected segment address lines (coded via bitfield salsel).. 1514131211109876543210 -------- dp4.7 dp4.6 dp4.5 dp4.4 dp4.3 dp4.2 dp4.1 dp4.0 rw rw rw rw rw rw rw rw bit function dp4.y port direction register dp4 bit y dp4.y = 0: port line p4.y is an input (high-impedance) dp4.y = 1: port line p4.y is an output 1514131211109876543210 --------odp4. 7 odp4. 6 ------ rw rw bit function odp4.y port 4 open drain control register bit y odp4.y = 0: port line p4.y output driver in push/pull mode odp4.y = 1: port line p4.y output driver in open drain mode if p4.y is not a segment address line output port 4 pin std. function salsel=01 64 kb altern. function salsel=11 256kb altern. function salsel=00 1mb altern. function salsel=10 16mb p4.0 p4.1 p4.2 p4.3 p4.4 p4.5 p4.6 p4.7 gpio gpio gpio gpio gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd seg. address a16 seg. address a17 gpio gpio gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd seg. address a16 seg. address a17 seg. address a18 seg. address a19 gpio/can2_rxd gpio/can1_rxd gpio/can1_txd gpio/can2_txd seg. address a16 seg. address a17 seg. address a18 seg. address a19 seg. address a20 seg. address a21 seg. address a22 seg. address a23
st10f280 89/186 figure 39 : block diagram of a port 4 pin figure 38 : port 4 i/o and alternate functions port 4 alternate function a) general purpose input / output b) segment address lines cans i/o and general purpose input / output p4.7 p4.6 p4.5 p4.4 p4.3 p4.2 p4.1 p4.0 a23 a22 a21 a20 a19 a18 a17 a16 can2_txd can1_txd can1_rxd can2_rxd p4.3 p4.2 p4.1 p4.0 direction latch write dp4.y read dp4.y port output latch write p4.y read p4.y internal bus mux 0 1 mux 0 1 alternate data output mux 0 1 1 input latch p4.y output buffer y = 7...0 alternate function enable cpu clock
st10f280 90/186 figure 40 : block diagram of p4.4 and p4.5 pins direction latch write dp4.x read dp4.x port output latch write p4.x read p4.x internal bus mux 0 1 mux 0 1 alternate data output mux 0 1 1 input latch clock p4.x x = 5, 4 alternate function enable 0 1 0 mux mux 0 1 0 output buffer & 1 y = 1, 2 (can channel) z = 2, 1 a = 0, 1 b = 1, 0 cany.rxd xpercon.a xpercon.b (canyen) (canzen)
st10f280 91/186 figure 41 : block diagram of p4.6 and p4.7 pins mux 0 1 "0" open drain latch write odp4.x read odp4.x direction latch write dp4.x read dp4.x internal bus mux 0 1 input latch clock p4.x output buffer port output latch read p4.x write p4.x alternate data output mux 0 1 mux 0 1 "1" mux alternate function enable mux 0 1 "1" mux mux 0 1 "0" mux 0 1 mux 1 cany.txd xpercon.a (canyen) xpercon.b (canzen) data output x = 6, 7 y = 1, 2 (can channel) z = 2, 1 a = 0, 1 b = 1, 0
st10f280 92/186 12.7 - port 5 this 16-bit input port can only read data. there is no output latch and no direction register. data written to p5 will be lost. p5 (ffa2h / d1h) sfr reset value: xxxxh alternate functions of port 5 each line of port 5 is also connected to one of the multiplexer of the analog/digital converter. all port lines (p5.15...p5.0) can accept analog signals (an15...an0) that can be converted by the adc. no special pro- gramming is required for pins that shall be used as analog inputs. some pins of port 5 also serve as exter- nal timer control lines for gpt1 and gpt2. the table below summarizes the alternate functions of port 5. 1514131211109876543210 p5.15 p5.14 p5.13 p5.12 p5.11 p5.10 p5.9 p5.8 p5.7 p5.6 p5.5 p5.4 p5.3 p5.2 p5.1 p5.0 rrrrrrrrrrrrrrrr bit function p5.y port data register p5 bit y (read only) table 17 : port 5 alternate functions port 5 pin alternate function a) alternate function b) p5.0 p5.1 p5.2 p5.3 p5.4 p5.5 p5.6 p5.7 p5.8 p5.9 p5.10 p5.11 p5.12 p5.13 p5.14 p5.15 analog input an0 analog input an1 analog input an2 analog input an3 analog input an4 analog input an5 analog input an6 analog input an7 analog input an8 analog input an9 analog input an10 analog input an11 analog input an12 analog input an13 analog input an14 analog input an15 - - - - - - - - - - t6eud timer 6 ext. up/down input t5eud timer 5 ext. up/down input t6in timer 6 count input t5in timer 5 count input t4eud timer 4 ext. up/down input t2eud timer 2 ext. up/down input figure 42 : port 5 i/o and alternate functions port 5 alternate function a) general purpose inputs b) a/d converter inputs timer inputs p5.7 p5.6 p5.5 p5.4 p5.3 p5.2 p5.1 p5.0 p5.15 p5.14 p5.13 p5.12 p5.11 p5.10 p5.9 p5.8 an7 an6 an5 an4 an3 an2 an1 an0 an15 an14 an13 an12 an11 an10 an9 an8 t2eud t4eud t5in t6in t5eud t6eud
st10f280 93/186 port 5 pins have a special port structure (see figure 43), first because it is an input only port, and second because the analog input channels are directly connected to the pins rather than to the input latches. 12.7.1 - port 5 schmitt trigger analog inputs a schmitt trigger protection can be activated on each pin of port 5 by setting the dedicated bit of register p5didis. p5didis (ffa4h / d2h) sfr reset value: 0000h 12.8 - port 6 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corre- sponding direction register dp6. each port line can be switched into push/pull or open drain mode via the open drain control register odp6. p6 (ffcch / e6h) sfr reset value: - - 00h dp6 (ffceh / e7h) sfr reset value: - - 00h figure 43 : block diagram of a port 5 pin 1514131211109876543210 p5di dis.15 p5di dis.14 p5di dis.13 p5di dis.12 p5di dis.11 p5di dis.10 p5di dis.9 p5di dis.8 p5di dis.7 p5di dis.6 p5di dis.5 p5di dis.4 p5di dis.3 p5di dis.2 p5di dis.1 p5di dis.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function p5didis.y port 5 digital disablel register bit y p5didis.y = 0: port line p5.y digital input is enabled (schmitt trigger enabled) p5didis.y = 1: port line p5.y digital input is disabled (schmitt trigger disabled, necessary for input leakage current reduction) 1514131211109876543210 -------- p6.7 p6.6 p6.5 p6.4 p6.3 p6.2 p6.1 p6.0 rw rw rw rw rw rw rw rw bit function p6.y port data register p6 bit y 1514131211109876543210 -------- dp6.7 dp6.6 dp6.5 dp6.4 dp6.3 dp6.2 dp6.1 dp6.0 rw rw rw rw rw rw rw rw read port p5.y internal bus input latch cpu clock p5.y/any read buffer to sample + hold circuit channel select analog switch y = 15...0
st10f280 94/186 odp6 (f1ceh / e7h) esfr reset value: - - 00h 12.8.1 - alternate functions of port 6 a programmable number of chip select signals (cs4...cs0) derived from the bus control registers (buscon4...buscon0) can be output on the 5 pins of port 6. the number of chip select signals is selected via port0 during reset. the selected value can be read from bitfield cssel in register rp0h (read only) e.g. in order to check the configuration during run time. the table below summarizes the alter- nate functions of port 6 depending on the number of selected chip select lines (coded via bitfield c ssel). figure 44 : port 6 i/o and alternate functions bit function dp6.y port direction register dp6 bit y dp6.y = 0: port line p6.y is an input (high-impedance) dp6.y = 1: port line p6.y is an output 1514131211109876543210 --------odp6.7o dp6.6odp6.5 odp6.4 odp6.3 odp6.2 odp6.1 odp6.0 rw rw rw rw rw rw rw rw bit function odp6.y port 6 open drain control register bit y odp6.y = 0: port line p6.y output driver in push/pull mode odp6.y = 1: port line p6.y output driver in open drain mode table 18 : port 6 alternate functions port 6 pin altern. function cssel = 10 altern. function cssel = 01 altern. function cssel = 00 altern. function cssel = 11 p6.0 p6.1 p6.2 p6.3 p6.4 general purpose i/o general purpose i/o general purpose i/o general purpose i/o general purpose i/o chip select cs0 chip select cs1 gen. purpose i/o gen. purpose i/o gen. purpose i/o chip select cs0 chip select cs1 chip select cs2 gen. purpose i/o gen. purpose i/o chip select cs0 chip select cs1 chip select cs2 chip select cs3 chip select cs4 p6.5 p6.6 p6.7 hold external hold request input hlda hold acknowledge output breq bus request output port 6 alternate function a) general purpose input/output p6.7 p6.6 p6.5 p6.4 p6.3 p6.2 p6.1 p6.0 breq hlda hold cs4 cs3 cs2 cs1 cs0
st10f280 95/186 the chip select lines of port 6 have an internal weak pull-up device. this device is switched on during reset. this feature is implemented to drive the chip select lines high during reset in order to avoid multiple chip selection. after reset the cs function must be used, if selected so. in this case there is no possibility to program any port latches before. thus the alternate function (cs ) is selected automatically in this case. note: the open drain output option can only be selected via software earliest during the initialization routine; at least signal cs0 will be in push/pull output driver mode directly after reset. figure 45 : block diagram of port 6 pins with an alternate output function * p6.5 has only alternate input function. 12.9 - port 7 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corre- sponding direction register dp7. each port line can be switched into push/pull or open drain mode via the open drain control register odp7. mux 0 1 "0" open drain latch write odp6.y read odp6.y direction latch write dp6.y read dp6.y internal bus mux 0 1 input latch cpu clock p6.y output buffer port output latch read p6.y write p6.y alternate * data output mux 0 1 mux 0 1 "1" mux alternate function enable y = (0...4, 6, 7)
st10f280 96/186 p7 (ffd0h / e8h) sfr reset value: - - 00h dp7 (ffd2h / e9h) sfr reset value: - - 00h odp7 (f1d2h / e9h) esfr reset value: - - 00h 12.9.1 - alternate functions of port 7 the upper 4 lines of port 7 (p7.7...p7.4) serve as capture inputs or compare outputs (cc31io...cc28io) for the capcom2 unit. the usage of the port lines by the capcom unit, its accessibility via software and the precautions are the same as described for the port 2 lines. as all other capture inputs, the capture input func- tion of pins p7.7...p7.4 can also be used as exter- nal interrupt inputs (200 ns sample rate at 40mhz cpu clock). the lower 4 lines of port 7 (p7.3...p7.0) serve as outputs from the pwm module (pout3...pout0). at these pins the value of the respective port output latch is xored with the value of the pwm output rather than anded, as the other pins do. this allows to use the alternate output value either as it is (port latch holds a 0) or invert its level at the pin (port latch holds a 1). note that the pwm outputs must be enabled via the respective penx bits in pwmcon1. the table below summarizes the alternate func- tions of port 7. 1514131211109876543210 - - - - - - - - p7.7 p7.6 p7.5 p7.4 p7.3 p7.2 p7.1 p7.0 rw rw rw rw rw rw rw rw p7.y port data register p7 bit y 1514131211109876543210 - - - - - - - - dp7.7 dp7.6 dp7.5 dp7.4 dp7.3 dp7.2 dp7.1 dp7.0 rw rw rw rw rw rw rw rw dp7.y port direction register dp7 bit y dp7.y = 0: port line p7.y is an input (high impedance) dp7.y = 1: port line p7.y is an output 1514131211109876543210 --------o dp7.7 odp7.6 odp7.5 odp7.4 odp7.3 odp7.2 odp7.1 odp7.0 rw rw rw rw rw rw rw rw odp7.y port 7 open drain control register bit y odp7.y = 0: port line p7.y output driver in push-pull mode odp7.y = 1: port line p7.y output driver in open drain mode table 19 : port 7 alternate functions port 7 pin alternate function p7.0 p7.1 p7.2 p7.3 p7.4 p7.5 p7.6 p7.7 pout0 pwm mode channel 0 output pout1 pwm mode channel 1 output pout2 pwm mode channel 2 output pout3 pwm mode channel 3 output cc28io capture input / compare output channel 28 cc29io capture input / compare output channel 29 cc30io capture input / compare output channel 30 cc31io capture input / compare output channel 31
st10f280 97/186 the port structures of port 7 differ in the way the output latches are connected to the internal bus and to the pin driver (see the two figure 47). pins p7.3...p7.0 (pout3...pout0) xor the alternate data output with the port latch output, which allows to use the alternate data directly or inverted at the pin driver. figure 46 : port 7 i/o and alternate functions figure 47 : block diagram of port 7 pins p7.3...p7.0 port 7 alternate function general purpose input/output p7.7 p7.6 p7.5 p7.4 p7.3 p7.2 p7.1 p7.0 cc31io cc30io cc29io cc28io pout3 pout2 pout1 pout0 open drain latch write odp7.y read odp7.y direction latch write dp7.y read dp7.y internal bus mux 0 1 input latch cpu clock p7.y/pouty output buffer port output latch read p7.y =1 port data output exor alternate data output write p7.y y = 0...3
st10f280 98/186 figure 48 : block diagram of port 7 pins p7.7...p7.4 open drain latch write odp7.y read odp7.y direction latch write dp7.y read dp7.y internal bus mux 0 1 alternate latch data input input latch clock p7.y cczio output buffer alternate data output mux 0 1 output latch 3 1 write port p7.y compare trigger read p7.y y = (4...7) z = (28...31) alternate pin data input
st10f280 99/186 12.10 - port 8 if this 8-bit port is used for general purpose i/o, the direction of each line can be configured via the corre- sponding direction register dp8. each port line can be switched into push/pull or open drain mode via the open drain control register odp8. p8 (ffd4h / eah) sfr reset value: - - 00h dp8 (ffd6h / ebh) sfr reset value: - - 00h odp8 (f1d6h / ebh) esfr reset value: - - 00h 12.10.1 - alternate functions of port 8 the 8 lines of port 8 (p8.7...p8.0) serve as capture inputs or compare outputs (cc23io...cc16io) for the capcom2 unit. the usage of the port lines by the capcom unit, its accessibility via software and the precautions are the same as described for the port 2 lines. as all other capture inputs, the capture input function of pins p8.7...p8.0 can also be used as external interrupt inputs (200 ns sample rate at 40mhz cpu clock). the table 20 summarizes the alternate functions of port 8. 1514131211109876543210 - - - - - - - - p8.7 p8.6 p8.5 p8.4 p8.3 p8.2 p8.1 p8.0 rw rw rw rw rw rw rw rw p8.y port data register p8 bit y 1514131211109876543210 - - - - - - - - dp8.7 dp8.6 dp8.5 dp8.4 dp8.3 dp8.2 dp8.1 dp8.0 rw rw rw rw rw rw rw rw dp8.y port direction register dp8 bit y dp8.y = 0: port line p8.y is an input (high impedance) dp8.y = 1: port line p8.y is an output 1514131211109876543210 --------odp8.7o dp8.6 odp8.5 odp8.4 odp8.3 odp8.2 odp8.1 odp8.0 rw rw rw rw rw rw rw rw odp8.y port 8 open drain control register bit y odp8.y = 0: port line p8.y output driver in push-pull mode odp8.y = 1: port line p8.y output driver in open drain mode table 20 : port 8 alternate functions port 7 alternate function p8.0 p8.1 p8.2 p8.3 p8.4 p8.5 p8.6 p8.7 cc16io capture input / compare output channel 16 cc17io capture input / compare output channel 17 cc18io capture input / compare output channel 18 cc19io capture input / compare output channel 19 cc20io capture input / compare output channel 20 cc21io capture input / compare output channel 21 cc22io capture input / compare output channel 22 cc23io capture input / compare output channel 23
st10f280 100/186 the port structures of port 8 differ in the way the output latches are connected to the internal bus and to the pin driver (see the figure 50). pins p8.7...p8.0 (cc23io...cc16io) combine internal bus data and alternate data output before the port latch input, as do the port 2 pins. figure 49 : port 8 i/o and alternate functions figure 50 : block diagram of port 8 pins p8.7...p8.0 port 8 alternate function general purpose input / output p8.7 p8.6 p8.5 p8.4 p8.3 p8.2 p8.1 p8.0 cc23io cc22io cc21io cc20io cc19io cc18io cc17io cc16io open drain latch write 0dp8.y read 0dp8.y direction latch write dp8.y read dp8.y internal bus mux 0 1 alternate latch data input input latch cpu clock p8.y cczio output buffer alternate data output mux 0 1 output latch 3 1 write port p8.y compare trigger read p8.y y = (7...0) z = (16...23) alternate pin data input
st10f280 101/186 12.11 - xport 9 the xport9 is enabled by setting xpen bit 2 of the syscon register and xport9en bit 3 of the new xpercon register. on the xbus interface, the register are not bit-addressable this 16-bit port is used for general purpose i/o, the direction of each line can be configured via the corre- sponding direction register xdp9. each port line can be switched into push/pull or open drain mode via the open drain control register xodp9. all port lines can be individually (bit-wise) programmed. the bit-addressable feature is available via spe- cific set and clear registers: xp9set, xp9clr, xdp9set, xdp9clr, xodp9set, xodp9clr. xp9 (c100h) reset value: 0000h xp9set (c102h) reset value: 0000h xp9clr (c104h) reset value: 0000h xdp9 (c200h) reset value: 0000h 1514131211109876543210 xp9.15 xp9.14 xp9.13 xp9.12 xp9.11 xp9.10 xp9.9 xp9.8 xp9.7 xp9.6 xp9.5 xp9.4 xp9.3 xp9.2 xp9.1 xp9.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function xp9.y port data register xp9 bit y 1514131211109876543210 xp9set .15 xp9set .14 xp9set .13 xp9set .12 xp9set .11 xp9set .10 xp9set .9 xp9set .8 xp9set .7 xp9set .6 xp9set .5 xp9set .4 xp9set .3 xp9set .2 xp9set .1 xp9set .0 wwwwwwwwwwwwwwww bit function xp9set.y writing a 1 will set the corresponding bit in xp9 register, writing a 0 has no effect. 1514131211109876543210 xp9clr .15 xp9clr .14 xp9clr .13 xp9clr .12 xp9clr .11 xp9clr .10 xp9clr .9 xp9clr .8 xp9clr .7 xp9clr .6 xp9clr .5 xp9clr .4 xp9clr .3 xp9clr .2 xp9clr .1 xp9clr .0 wwwwwwwwwwwwwwww bit function xp9clr.y writing a 1 will clear the corresponding bit in xp9 register, writing a 0 has no effect. 1514131211109876543210 xdp9 .15 xdp9 .14 xdp9 .13 xdp9 .12 xdp9 .11 xdp9 .10 xdp9 .9 xdp9 .8 xdp9 .7 xdp9 .6 xdp9 .5 xdp9 .4 xdp9 .3 xdp9 .2 xdp9 .1 xdp9 .0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function xdp9.y port direction register xdp9 bit y xdp9.y = 0: port line xp9.y is an input (high-impedance) xdp9.y = 1: port linex p9.y is an output
st10f280 102/186 xdp9set (c202h) reset value: 0000h xdp9clr (c204h) reset value: 0000h xodp9 (c300h) reset value: 0000h xodp9set (c302h) reset value: 0000h xodp9clr (c304h) reset value: 0000h 1514131211109876543210 xdp9 set.15 xdp9 set.14 xdp9 set.13 xdp9 set.12 xdp9 set.11 xdp9 set.10 xdp9 set.9 xdp9 set.8 xdp9 set.7 xdp9 set.6 xdp9 set.5 xdp9 set.4 xdp9 set.3 xdp9 set.2 xdp9 set.1 xdp9 set.0 wwwwwwwwwwwwwwww bit function xdp9set.y writing a 1 will set the corresponding bit in xdp9 register, writing a 0 has no effect. 1514131211109876543210 xdp9 clr.15 xdp9 clr.14 xdp9 clr.13 xdp9 clr.12 xdp9 clr.11 xdp9 clr.10 xdp9 clr.9 xdp9 clr.8 xdp9 clr.7 xdp9 clr.6 xdp9 clr.5 xdp9 clr.4 xdp9 clr.3 xdp9 clr.2 xdp9 clr.1 xdp9 clr.0 wwwwwwwwwwwwwwww bit function xdp9clr.y writing a 1 will clear the corresponding bit in xdp9 register, writing a 0 has no effect. 1514131211109876543210 xodp9 .15 xodp9 .14 xodp9 .13 xodp9 .12 xodp9 .11 xodp9 .10 xodp9 .9 xodp9 .8 xodp9 .7 xodp9 .6 xodp9 .5 xodp9 .4 xodp9 .3 xodp 9.2 xodp9 .1 xodp9 .0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function xodp9.y port 9 open drain control register bit y xodp9.y = 0: port line xp9.y output driver in push/pull mode xodp9.y = 1: port line xp9.y output driver in open drain mode 1514131211109876543210 xodp9 set.15 xodp9 set.14 xodp9 set.13 xodp9 set.12 xodp9 set.11 xodp9 set.10 xodp9 set.9 xodp9 set.8 xodp9 set.7 xodp9 set.6 xodp9 set.5 xodp9 set.4 xodp9 set.3 xodp9 set.2 xodp9 set.1 xodp9 set.0 wwwwwwwwwwwwwwww bit function xodp9set.y writing a 1 will set the corresponding bit in xodp9 register, writing a 0 has no effect. 1514131211109876543210 xodp9 clr.15 xodp9 clr.14 xodp9 clr.13 xodp9 clr.12 xodp9 clr.11 xodp9 clr.10 xodp9 clr.9 xodp9 clr.8 xodp9 clr.7 xodp9 clr.6 xodp9 clr.5 xodp9 clr.4 xodp9 clr.3 xodp9 clr.2 xodp9 clr.1 xodp9 clr.0 wwwwwwwwwwwwwwww bit function xodp9clr.y writing a 1 will clear the corresponding bit in xodp9 register, writing a 0 has no effect.
st10f280 103/186 12.12 - xport 10 the xport10 is enabled by setting xpen bit 2 of the syscon register and bit 3 of the new xpercon register. on the xbus interface, the register are not bit-addressable. this 16-bit input port can only read data. there is no output latch and no direction register. data written to xp10 will be lost. xp10 (c380h) reset value: xxxxh 12.12.1 - alternate functions of xport 10 each line of xport 10 is also connected to one of the multiplexer of the analog/digital converter. all port lines (xp10.15...xp10.0) can accept analog signals (an31...an16) that can be converted by the adc. no special programming is required for pins that shall be used as analog inputs. the table 21 summarizes the alternate functions of xport 10. figure 51 : port10 i/o and alternate functions 1514131211109876543210 xp10 .15 xp10 .14 xp10 .13 xp10 .12 xp10 .11 xp10 .10 xp10 .9 xp10 .8 xp10 .7 xp10 .6 xp10 .5 xp10 .4 xp10 .3 xp10 .2 xp10 .1 xp10 .0 rrrrrrrrrrrrrrrr bit function xp10.y port data register xp10 bit y (read only) table 21 : xport 10 alternate functions xport 10 pin alternate function p10.0 p10.1 p10.2 p10.3 p10.4 p10.5 p10.6 p10.7 p10.8 p10.9 p10.10 p10.11 p10.12 p10.13 p10.14 p10.15 analog input an16 analog input an17 analog input an18 analog input an19 analog input an20 analog input an21 analog input an22 analog input an23 analog input an24 analog input an25 analog input an26 analog input an27 analog input an28 analog input an29 analog input an30 analog input an31 a/d converter input an31 an30 an29 an28 an27 an26 an25 an24 an23 an22 an21 an20 an19 an18 an17 an16 xport 10 alternate function general purpose input xp10.15 xp10.14 xp10.13 xp10.12 xp10.11 xp10.10 xp10.9 xp10.8 xp10.7 xp10.6 xp10.5 xp10.4 xp10.3 xp10.2 xp10.1 xp10.0
st10f280 104/186 12.12.2 - new disturb protection on analog inputs a new register is provided for additional disturb protection support on analog inputs for port xp10: xp10didis (c382h) reset value: 0000h 1514131211109876543210 xp10 didis .15 xp10 didis .14 xp10 didis .13 xp10 didis .12 xp10 didis .11 xp10 didis .10 xp10 didis.9 xp10 didis.8 xp10 didis.7 xp10 didis.6 xp10 didis.5 xp10 didis.4 xp10 didis.3 xp10 didis.2 xp10 didis.1 xp10 didis.0 rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function xp10didis.y 0 1 xport 10 digital disable register bit y port line xp10.y digital input is enabled (schmitt trigger enabled) port line xp10.y digital input is disabled (schmitt trigger disabled, necessary for input leakage current reduction)
st10f280 105/186 13 - a/d converter 13.1 - a/d converter module a 10-bit a/d converter with 2 x 16 multiplexed input channels and a sample and hold circuit is integrated on-chip. this a/d converter does not have the self-calibration feature. thus, guaran- teed total unadjusted error is + 2 lsb. refer to section 20.3.1 - a/d converter characteristics for detailled characteristics. the sample time (for loading the capacitors) and the conversion time is programmable and can be adjusted to the exter- nal circuitry. convertion time is fully equivalent to the one of previous generation a/d self-calibrated converter. to remove high frequency components from the analog input signal, a low-pass filter must be con- nected at the adc input. overrun error detection/protection is controlled by the addat register. either an interrupt request is generated when the result of a previous conver- sion has not been read from the result register at the time the next conversion is complete, or the next conversion is suspended until the previous result has been read. for applications which require less than 16 analog input channels, the remaining channel inputs can be used as digital input port pins. the a/d converter of the st10f280 supports four different conversion modes: single channel conversion mode the analog level on a specified channel is sampled once and converted to a digital result. single channel continuous mode the analog level on a specified channel is repeatedly sampled and converted without software intervention. auto scan mode the analog levels on a pre-spec- ified number of channels are sequentially sampled and converted. auto scan continuous mode the number of pre-specified channels is repeatedly sampled and converted. channel injection mode injects a channel into a running sequence without disturbing this sequence. the peripheral event controller stores the conversion results in memory without entering and exiting interrupt routines for each data transfer.
st10f280 106/186 13.2 - multiplexage of two blocks of 16 analog inputs the adc can manage 16 analog inputs, so to increase its capability, a new xadcmux register is added to control the multiplexage between the first block of 16 channels on port5 and the second block of 16 channels on xport10. the conversion result register stays identical and only a software management can determine the block in use. the xadcmux register is enabled by setting xpen bit 2 of the syscon register and bit 3 of the new xpercon register xadcmux (c384h) reset value: 0000h figure 52 : block diagram 151413121110987654321 0 ---------------x adcmux rw bit function xadcmux.0 0 1 default configuration,analog inputs on port p5.y can be converted analog inputs on port xp10.y can be converted y = 15...0 input latch input latch adc read port p5.y read port xp10.y channel select xadcmux 0 1 cpu clock cpu clock p5.y xp10.y 16 16 xbus internal bus
st10f280 107/186 13.3 - xtimer peripheral (trigger for adc channel injection) this new peripheral is dedicated for the channel injection mode of the a/d converter. this mode injects a channel into a running sequence without disturbing this sequence. the peripheral event controller stores the conversion results in memory without entering and exiting interrupt routines for each data transfer. a channel injection can be triggered by an event on capture/compare cc31 (port p7.7) of the capcom2 unit. the dedicated output xadcinj of the xtimer must be connected externally on the input p7.7/ cc31. due to the multiplexed inputs, at a time, the adc exclusively converts the port5 inputs or the xport10 inputs. if one "y" channel has to be used continuously in injection mode, it must be exter- nally hardware connected to the port5.y and xport10.y inputs. the xtimer peripheral is enabled by setting xpen bit 2 of the syscon register and bit 3 of the new xpercon register. 13.3.1 - main features the xtimer features are : C 16 bits linear timer / 4 bits exponential prescaler C counting between 16 bits start value and 16 bits end value C counting period between 4 cycles and 2**33 cy- cles (100 ns and 214s using 40mhz cpu clock) C 1 trigger ouput (xadcinj) C programmable functions : ? internal clock xclk is derivated from the cpu clock and has the same period ? up counting / down counting ? reload enable ? continue / stop modes C 4 memory mapped registers : ? control / prescaler ? start value ? end value ? current value table 22 : the different counting modes tle tcs tcvr(n) = tevr tud ten tcvr(n+1) comments x x x x 0 tcvr(n) timer disable x 0 1 x 1 stop x x 0 0 tcvr(n)-1 decrement 0 1 1 decrement (continue) x x 0 1 tcvr(n)+1 increment 0 1 1 increment (continue) 1 1 1 x tsvr load
st10f280 108/186 13.3.2 - register description 13.3.2.1 - tcr : timer control register xtcr (c000h) reset value: 0000h 1514131211109876543210 000000 t fp[3:0] tcm tie tcs tle tud ten rrrrrr rw rwrwrwrwrwrw bit function ten timer enable when ten = 0, the timer is disabled (reset value). to avoid glitches, it is recommended to modify tcr in 2 steps, first with new values and and second by setting ten. tud timer up / down counting when tud = 0, the timer is counting "down" (reset value), ie the tcvr (current value) register content is decremented. when tud = 1, the timer is counting "up" , ie the tcvr (current value) register content is incremented. tle timer load enable when the counter has reached its end value (tcvr = tevr), tcvr is (re)loaded with tsvr (start value) register content when tle = 1. when tle = 0 (reset value), the next state of tcvr depends on tcs bit. tcs timer continue / stop when tle = 0 (no load) and when the counter has reached its end value (tcvr = tevr), the tcvr content continues to increment / decrement according to tud bit when tcs = 1 ( continue mode). when tcs = 0 ( stop mode reset value), tcvr is stopped and its content is frozen. tie timer output enable when the counter has reached its end value (tcvr = tevr), the xadcinj output is set when tie = 1. when tie = 0 (reset value), xadcinj output is disabled (= 0). tcm timer clock mode must be cleared tcm = 0 (reset value), the tcvr clock is derived from internal xclk clock according to tfp bits. tfp[3:0] timer frequency prescaler when tcm = 0 (internal clock), the tcvr register clock is derived from the xclk clock input by dividing xclk by 2**(2+ tfp). the coding is as follows : - 0000 : prescaler by 2 (reset value), xclk divided by 4 - 0001 : prescaler by 4, xclk divided by 8 - 0010 : prescaler by 8, xclk divided by 16 - ... - 1111 : prescaler by 2**16, xclk divided by 2**17
st10f280 109/186 13.3.2.2 - xtsvr :timer start value register xtsvr (c002h) reset value: 0000h 13.3.2.3 - xtevr : timer end value register xtevr (c004h) reset value: 0000h 13.3.2.4 - xtcvr : timer current value register xtcvr (c006h) reset value: 0000h 13.3.2.5 - registers mapping 1514131211109876543210 tsvr rw bit function tsvr[15:0] timer start value tsvr contains the data to be transferred to the tcvr current value register when : 1) - ten = 1 (tim enable), - tle = 1 (tim load enable), - tcvr = tevr (count period finished), - tcs = 1 (stop mode disabled). 2) - first counting clock rising edge after the timer start (the timer starts on ten rising edge). 1514131211109876543210 tevr rw bit function tevr[15:0] timer end value tevr contains the data to be compared to the tcvr current value register. 1514131211109876543210 tcvr r bit function tcvr[15:0] timer current value tcvr contains the current counting value. when tcvr = tevr, tcvr content is changed according to table 22. the tcvr clock is derived from internal xclk clock according to tfp bits when tcm = 0. table 23 : timer registers mapping address (hexa) register name reset value (hexa) access c000h xtcr : control 0000h rw c002h xtsvr : start value 0000h rw c004h xtevr : end value 0000h rw c006h xtcvr : current value 0000h r
st10f280 110/186 13.3.3 - block diagram 13.3.3.1 - clocks the xtcvr register clock is the prescaler output. the prescaler allows to divide the basic register frequency in order to offer a wide range of count- ing period, from 2**2 to 2**33 cycles (note that 1 cycle = 1 xclk periods). 13.3.3.2 - registers the xtcvr register input is linked to several sources: C xtsvr register (start value) for reload when the period is finished, or for load when the timer is starting. C incrementer output when the up mode is selected, C decrementer output when the down mode is selected. C the selection between the sources is made through the xtcr control register. when starting the timer, by setting ten bit of tcr to 1, xtcvr will be loaded with xtsvr value on the first rising edge of the counting clock. thats to say that for counting from 0000h to 0009h for example, 10 counting clock rising edges are required. the xtcvr register output is continuously com- pared to the xtevr register to detect the end of the counting period. when the registers are equal, several actions are made depending on the xtcr control register content : C the output xadcinj is conditionally generated, C xtcvr is loaded with xtsvr or stops or contin- ues to count (see table 22). xtevr, xtsvr and all tcr bits except ten must not be modified while the timer is counting, ie while ten bit of tcr = 1. the timer behaviour is not guaranteed if this rule is not respected. it implies that the timer can be configured only when stopped (ten = 0). when programming the timer, xtevr, xtsvr and xtcr bits except ten can be modified, with ten = 0; then the timer is started by modifying only ten bit of tcr. to stop the timer, only ten bit should be modified, from 1 to 0. figure 53 : xtimer block diagram xtcr xtsvr xtcvr prescaling xtevr ctl ctl = ctl ctl diff xclk - 1 + 1 timer output data (xadcinj)
st10f280 111/186 13.3.3.3 - timer output (xadcinj) the xadcinj output is the result of the (xtcvr = xtevr) flag after differentiation. the duration of the output lasts two cycles (50ns at 40mhz). figure 54 : xadcinj timer output figure 55 : external connection for adc channel injection xadcinj 4 tcl =50ns xclk input latch xtimer clock p7.7/cc31 xadcinj capcom2 output trigger for adc unit channel injection
st10f280 112/186 14 - serial channels serial communication with other microcontrollers, microprocessors, terminals or external peripheral components is provided by two serial interfaces: the asynchronous / synchronous serial channel (asco) and the high-speed synchronous serial channel (ssc). two dedicated baud rate generators set up all standard baud rates without the requirement of oscillator tuning. for transmission, reception and erroneous reception, 3 separate interrupt vectors are provided for each serial channel. 14.1 - asynchronous / synchronous serial interface (asco) the asynchronous / synchronous serial interface (asco) provides serial communication between the st10f280 and other microcontrollers, microprocessors or external peripherals. a set of registers is used to configure and to control the asco serial interface: C p3, dp3, odp3 for pin configuration C sobg for baud rate generator C sotbuf for transmit buffer C sotic for transmit interrupt control C sotbic for transmit buffer interrupt control C socon for control C sorbuf for receive buffer (read only) C soric for receive interrupt control C soeic for error interrupt control 14.1.1 - asco in asynchronous mode in asynchronous mode, 8 or 9-bit data transfer, parity generation and the number of stop bit can be selected. parity framing and overrun error detection is provided to increase the reliability of data transfers. transmission and reception of data is double-buffered. full-duplex communication up to 1.25m bauds (at 40mhz of f cpu ) is supported in this mode. figure 56 : asynchronous mode of serial channel asc0 pin 2 cpu clock s0r baud rate timer reload register 16 clock serial port control shift clock s0m s0stp s0fe s0oe s0pe s0ren s0fen s0pen s0oen s0lb s0rir s0tir s0eir receive interrupt request transmit interrupt request error interrupt request transmit shift register receive shift register transmit buffer register s0tbuf receive buffer register s0rbuf sampling mux 0 1 pin input internal bus rxd0/p3.11 output txd0 / p3.10
st10f280 113/186 asynchronous mode baud rates for asynchronous operation, the baud rate generator provides a clock with 16 times the rate of the established baud rate. every received bit is sampled at the 7th, 8th and 9th cycle of this clock. the baud rate for asynchronous operation of serial channel asc0 and the required reload value for a given baud rate can be determined by the following formulas: (s0brl) represents the content of the reload register, taken as unsigned 13 bit integer, (s0brs) represents the value of bit s0brs (0 or 1), taken as integer. using the above equation, the maximum baud rate can be calculated for any given clock speed. baud rate versus reload register value (sobrs=0 and sobrs=1) is described in table 24. note: the deviation errors given in the table 24 are rounded. to avoid deviation errors use a baud rate crystal (providing a multiple of the asc0/ssc sampling frequency). b async = f cpu 16 x [2 + (s0brs)] x [(s0brl) + 1] s0brl = ( f cpu 16 x [2 + (s0brs)] x b async ) 1 table 24 : commonly used baud rates by reload value and deviation errors s0brs = 0, f cpu = 40mhz s0brs = 1, f cpu = 40mhz baud rate (baud) deviation error reload value (hexa) baud rate (baud) deviation error reload value (hexa) 1 250 000 0.0% / 0.0% 0000 / 0000 833 333 0.0% / 0.0% 0000 / 0000 112 000 +1.5% /7.0% 000a / 000b 112 000 +6.3% /7.0% 0006 / 0007 56 000 +1.5% /3.0% 0015 / 0016 56 000 +6.3% /0.8% 000d / 000e 38 400 +1.7% /1.4% 001f / 0020 38 400 +3.3% /1.4% 0014 / 0015 19 200 +0.2% /1.4% 0040 / 0041 19 200 +0.9% /1.4% 002a / 002b 9 600 +0.2% /0.6% 0081 / 0082 9 600 +0.9% /0.2% 0055 / 0056 4 800 +0.2% /0.2% 0103 / 0104 4 800 +0.4% /0.2% 00ac / 00ad 2 400 +0.2% /0.0% 0207 / 0208 2 400 +0.1% /0.2% 015a / 015b 1 200 0.1% / 0.0% 0410 / 0411 1 200 +0.1% /0.1% 02b5 / 02b6 600 0.0% / 0.0% 0822 / 0823 600 +0.1% /0.0% 056b / 056c 300 0.0% / 0.0% 1045 / 1046 300 0.0% / 0.0% 0ad8 / 0ad9 153 0.0% / 0.0% 1fe8 / 1fe9 102 0.0% / 0.0% 1fe8 / 1fe9
st10f280 114/186 14.1.2 - asco in synchronous mode in synchronous mode, data are transmitted or received synchronously to a shift clock which is generated by the st10f280. half-duplex communication up to 5m baud (at 40mhz of f cpu ) is possible in this mode. figure 57 : synchronous mode of serial channel asc0 2 cpu clock s0r baud rate timer reload register 4 clock serial port control shift clock s0m = 000b s0oe s0ren s0oen s0lb s0rir s0tir s0eir receive interrupt request transmit interrupt request error interrupt request transmit shift register receive shift register transmit buffer register s0tbuf receive buffer register s0rbuf mux 0 1 pin internal bus receive output transmit pin input/output tdx0/p3.10 rxd0/p3.11
st10f280 115/186 synchronous mode baud rates for synchronous operation, the baud rate generator provides a clock with 4 times the rate of the established baud rate. the baud rate for synchronous operation of serial channel asc0 can be determined by the following formula: (s0brl) represents the content of the reload register, taken as unsigned 13 bit integers, (s0brs) represents the value of bit s0brs (0 or 1), taken as integer. using the above equation, the maximum baud rate can be calculated for any clock speed as given in table 25. note: the deviation errors given in the table 25 are rounded. to avoid deviation errors use a baud rate crystal (providing a multiple of the asc0/ssc sampling frequency) b sync = s0brl = ( f cpu 4 x [2 + (s0brs)] x b sync ) 1 f cpu 4 x [2 + (s0brs)] x [(s0brl) + 1] table 25 : commonly used baud rates by reload value and deviation errors s0brs = 0, f cpu = 40mhz s0brs = 1, f cpu = 40mhz baud rate (baud) deviation error reload value (hexa) baud rate (baud) deviation error reload value (hexa) 5 000 000 0.0% / 0.0% 0000 / 0000 3 333 333 0.0% / 0.0% 0000 / 0000 112 000 +1.5% /0.8% 002b / 002c 112 000 +2.6% /0.8% 001c / 001d 56 000 +0.3% /0.8% 0058 / 0059 56 000 +0.9% /0.8% 003a / 003b 38 400 +0.2% /0.6% 0081 / 0082 38 400 +0.9% /0.2% 0055 / 0056 19 200 +0.2% /0.2% 0103 / 0104 19 200 +0.4% /0.2% 00ac / 00ad 9 600 +0.2% /0.0% 0207 / 0208 9 600 +0.1% /0.2% 015a / 015b 4 800 +0.1% /0.0% 0410 / 0411 4 800 +0.1% /0.1% 02b5 / 02b6 2 400 0.0% / 0.0% 0822 / 0823 2 400 +0.1% /0.0% 056b / 056c 1 200 0.0% / 0.0% 1045 / 1046 1 200 0.0% / 0.0% 0ad8 / 0ad9 900 0.0% / 0.0% 15b2 / 15b3 600 0.0% / 0.0% 15b2 / 15b3 612 0.0% / 0.0% 1fe8 / 1fe9 407 0.0% / 0.0% 1ffd / 1ffe
st10f280 116/186 14.2 - high speed synchronous serial channel (ssc) the high-speed synchronous serial interface ssc provides flexible high-speed serial communication between the st10f280 and other microcontrollers, microprocessors or external peripherals. the ssc supports full-duplex and half-duplex synchronous communication. the serial clock signal can be generated by the ssc itself (master mode) or be received from an external master (slave mode). data width, shift direction, clock polarity and phase are programmable. this allows communication with spi-compatible devices. transmission and reception of data is double-buffered. a 16-bit baud rate generator provides the ssc with a separate serial clock signal. the serial channel ssc has its own dedicated 16-bit baud rate generator with 16-bit reload capability, allowing baud rate generation independent from the timers. figure 58 : synchronous serial channel ssc block diagram baud rate generator ssc control block pin internal bus clock control cpu clock slave clock master clock sclk shift clock status control receive interrupt request transmit interrupt request error interrupt request 16-bit shift register pin control pin pin mtsr mrst transmit buffer register ssctb receive buffer register sscrb
st10f280 117/186 baud rate generation the baud rate generator is clocked by f cpu /2. the timer is counting downwards and can be started or stopped through the global enable bit sscen in register ssccon. register sscbr is the dual-function baud rate generator/reload register. reading sscbr, while the ssc is enabled, returns the content of the timer. reading sscbr, while the ssc is disabled, returns the programmed reload value. in this mode the desired reload value can be written to sscbr. note never write to sscbr, while the ssc is enabled. the formulas below calculate the resulting baud rate for a given reload value and the required reload value for a given baud rate: (sscbr) represents the content of the reload register, taken as unsigned 16 bit integer. table 26 lists some possible baud rates against the required reload values and the resulting bit times for a 40mhz cpu clock. baud rate ssc = f cpu 2 x [(sscbr) + 1] sscbr = ( f cpu 2 x baud rate ssc ) 1 table 26 : synchronous baud rate and reload values baud rate bit time reload value reserved use a reload value > 0. --- --- 10m baud 100ns 0001h 5m baud 200ns 0003h 2.5m baud 400ns 0007h 1m baud 1 m s 0013h 100k baud 10 m s 00c7h 10k baud 100 m s 07cfh 1k baud 1ms 4e1fh 306 baud 3.26ms ff4eh
st10f280 118/186 15 - can modules the two integrated can modules (can1 and can2) are identical and handle the completely autonomous transmission and reception of can frames in accordance with the can specification v2.0 part b (active) i.e. the on-chip can module can receive and transmit standard frames with 11-bit identifiers as well as extended frames with 29-bit identifiers. because of duplication of can controllers, the fol- lowing adjustements are to be considered: C the same internal register addresses both can controllers, but with the base addresses differing in address bit a8 and separate chip select for each can module. for address mapping, see chapter 4. C the can1 transmit line (can1_txd) is the alter- nate function of the port p4.6 and the receive line (can1_rxd) is p4.5. C the can2 transmit line (can2_txd) is the alter- nate function of the port p4.7 and the receive line (can2_rxd) is the alternate function of the port p4.4. C interrupt of can2 is connected to the xbus in- terrupt line xp1 (can1 is on xp0). C because of the new xpercon register, both can modules have to be selected, before the bit xpen is set in syscon register. C after reset, the can1 is selected with the related control bit in the xpercon register. the can2 is not selected. 15.1 - memory mapping 15.1.1 - can1 address range 00ef00h 00efffh is reserved for the can1 module access. the can1 is enabled by setting bit 0 of the new xpercon register before setting xpen bit 2 of the syscon register. accesses to the can module use demul- tiplexed addresses and a 16-bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate waitstate is used. 15.1.2 - can2 address range 00ee00h 00eeffh is reserved for the can2 module access. the can2 is enabled by setting xpen bit 2 of the syscon register and bit 1 of the new xpercon register. accesses to the can module use demultiplexed addresses and a 16-bit data bus (byte accesses are possible). two waitstates give an access time of 100 ns at 40mhz cpu clock. no tristate wait- state is used. note: if one or the two can modules are used, port 4 can not be programmed to output all 8 segment address lines. thus, only 4 segment address lines can be used, reducing the external memory space to 5m bytes (1m byte per cs line). 15.2 - can bus configurations depending on application, can bus configuration may be one single bus with a single or multiple interfaces or a multiple bus with a single or multiple interfaces. the st10f280 is able to support these 2 cases. single can bus the single can bus multiple interfaces configuration may be implemented using 2 can transceives as shown in figure 59. the st10f280 also supports single can bus multiple (dual) interfaces using the open drain option of the canx_txd output as shown in fig- ure 60. thanks to the or-wired connection, only one transceiver is required. in this case the design of the application must take in account the wire length and the noise environment. figure 59 : single can bus multiple interfaces - multiple transceivers figure 60 : single can bus dual interfaces - single transceiver can1 rxd txd can2 rxd txd can transceiver can transceiver can_h can_h can bus can1 rxd txd can2 rxd txd can transceiver can_h can_h can bus * open drain output +5v 2.7k w * *
st10f280 119/186 multiple can bus the st10f280 provides 2 can interfaces to support the kind of bus configuration shown in figure 61. 15.3 - register and message object organization all registers and message objects of the can controller are located in the special can address area of 256 bytes, which is mapped into segment 0 and uses addresses 00ee00h through 00efffh. all registers are organized as 16 bit registers, located on word addresses. however, all registers may be accessed byte wise in order to select special actions without effecting other mechanisms. note the address map shown in figure 62 lists the registers which are part of the can controller. there are also st10f280 specific registers that are associated with the can module. these registers, however, control the access to the can module rather than its function. figure 62 : can module address map figure 61 : connection to two different can buses (e.g. for gateway application) can1 rxd txd can2 rxd txd can transceiver can transceiver can_h can_h can can bus 2 bus 1 ef00h/ee00h ef02h/ee02h ef04h/ee04h ef06h/ee06h ef08h/ee08h ef0ch/ee0ch message object 15 message object 14 message object 13 message object 12 message object 11 message object 10 message object 9 message object 8 message object 7 message object 6 message object 5 message object 4 message object 3 message object 2 message object 1 general registers can address area general registers ef00h ef10h ef20h ef30h ef40h ef50h ef60h ef70h ef80h ef90h efa0h efb0h efc0h efd0h efe0h eff0h control / status register interrupt register bit timing register global mask short global mask long mask of last message ee00h ee10h ee20h ee30h ee40h ee50h ee60h ee70h ee80h ee90h eea0h eeb0h eec0h eed0h eee0h eef0h can1 can2
st10f280 120/186 control / status register (ef00h/ee00h) xreg reset value: xx01h table 27 : can control/status register 1514131211109876543210 boff ewrn - rxok txok lec tst cce 0 0 eie sie ie init r r rw rw rw rw rw r r rw rw rw rw bit function (control bit) init initialization 1: software initialization of the can controller. while init is set, all message transfers are stopped. setting init does not change the configuration registers and does not stop transmission or reception of a message in progress. the init bit is also set by hardware, following a busoff condition; the cpu then needs to reset init to start the bus recovery sequence. 0: disable software initialization of the can controller; on ini completion, the can waits for 11 consecutive recessive bit before taking part in bus activities. ie interrupt enable does not affect status updates. 1: global interrupt enable from can module. 0: global interrupt disable from can module. sie status change interrupt enable 1: enables interrupt generation when a message transfer (reception or transmision is successfully completed) or can bus error is detected and registered in lec is the status partition. 0: disable status change interrupt. eie error interrupt enable 1: enables interrupt generation on a change of bit boff or ewarn in the status partition. 0: disable error interrupt. cce configuration change enable 1: allows cpu access to the bit timing register 0: disables cpu access to the bit timing register tst test mode (bit 7) make sure that bit 7 is cleared when writing to the control register. writing a 1 during normal operation may lead erroneous device behaviour. lec last error code this field holds a code which indicates the type of the last error occurred on the can bus. if a message has been transferred (reception or transmission) without error, this field will be cleared. code 7 is unused and may be written by the cpu to check for updates. 0: no error 1: stuff error: more than 5 equal bit in a sequence have occurred in a part of a received message where this is not allowed. 2: form error: a fixed format part of a received frame has the wrong format. 3: ackerror: the message this can controller transmitted was not acknowledged by another node 4: bit1error: during the transmission of a message (with the exception of the arbitration field), the device wanted to send a recessive level (1), but the monitored bus value was dominant 5: bit0error: during the transmission of a message (or acknowledge bit, active error flag, or overload flag), the device wanted to send a dominant level (0), but the monitored bus value was recessive . during busoff recovery this status is set each time a sequence of 11 recessive bit has been monitored. this enables the cpu to monitor the proceeding of the busoff recovery sequence (indicating the bus is not stuck at dominant or continuously disturbed). 6: crcerror: the crc check sum was incorrect in the message received.
st10f280 121/186 note reading the upper half of the control register (status partition) will clear the status change interrupt value in the interrupt register, if it is pending. use byte accesses to the lower half to avoid this. 15.4 - can interrupt handling the on-chip can module has one interrupt output, which is connected (through a synchronization stage) to a standard interrupt node in the st10f280 in the same manner as all other interrupts of the standard on-chip peripherals. the control register for this interrupt is xp0ic (located at address f186h/c3h for can1 and f18eh/c7h for can2 in the esfr range). the associated interrupt vector is called xp0int at location 100h (trap number 40h) and xp1int at location 104h (trap number 41h). with this configuration, the user has all control options available for this interrupt, such as enabling/ disabling, level and group priority, and interrupt or pec service (see note below). as for all other interrupts, the interrupt request flag xp0ir/xp1ir in register xp0ic/xp1ic is cleared automatically by hardware when this interrupt is serviced (either by standard interrupt or pec ser- vice). note as a rule, can interrupt requests can be serviced by a pec channel. however, because pec channels only can execute single predefined data transfers (there are no conditional pec transfers), pec service can only be used, if the respective request is known to be generated by one specific source, and that no other interrupt request will be generated in between. in practice this seems to be a rare case. since an interrupt request of the can module can be generated due to different conditions, the appropriate can interrupt status register must be read in the service routine to determine the cause of the interrupt request. the interrupt identifier intid (a number) in the interrupt register indicates the cause of an interrupt. when no interrupt is pending, the identifier will have the value 00h. if the value in intid is not 00h, then there is an interrupt pending. if bit ie in the control register is set, also the interrupt line to the cpu is activated. the interrupt line remains active until either intid gets 00h (after the interrupt requester has been serviced) or until ie is reset (if interrupts are disabled). the interrupt with the lowest number has the highest priority. if a higher priority interrupt (lower number) occurs before the current interrupt is processed, intid is updated and the new interrupt overrides the last one. the table 28 lists the valid values for intid and their corresponding interrupt sources. txok transmitted message successfully indicates that a message has been transmitted successfully (error free and acknowledged by at least one other node), since this bit was last reset by the cpu (the can controller does not reset this bit!). rxok received message successfully indicates that a message has been received successfully, since this bit was last reset by the cpu (the can controller does not reset this bit!). ewrn error warning status indicates that at least one of the error counters in the eml has reached the error warning limit of 96. boff busoff status indicates when the can controller is in busoff state (see eml). bit function (control bit)
st10f280 122/186 interrupt register (ef02h/ee02h) xreg reset value: - - xxh table 28 : intid values and corresponding interrupt sources notes 1) bit intpnd of the corresponding message object has to be cleared to give messages with a lower priority the possibility to update intid or to reset intid to 00h (idle state). 2) a message interrupt code is only displayed, if there is no other interrupt request with a higher priority. bit timing configuration according to the can protocol specification, a bit time is subdivided into four segments: sync segment, propagation time segment, phase buffer segment 1 and phase buffer segment 2. each segment is a multiple of the time quantum t q with t q = ( brp + 1 ) x2 xt xclk the synchronization segment (sync seg) is always 1 t q long. the propagation time segment and the phase buffer segment1 (combined to tseg1) defines the time before the sample point, while phase buffer segment2 (tseg2) defines the time after the sample point. the length of these segments is programmable (except sync-seg). note for exact definition of these segments please refer to the can specification. 1514131211109876543210 reserved intid r bit function intid interrupt identifier this number indicates the cause of the interrupt. when no interrupt is pending, the value will be 00. intid cause of the interrupt 00 interrupt idle: there is no interrupt request pending. 01 status change interrupt: the can controller has updated (not necessarily changed) the status in the control register. this can refer to a change of the error status of the can controller (eie is set and boff or ewrn change) or to a can transfer incident (sie must be set), like reception or transmission of a message (rxok or txok is set) or the occurrence of a can bus error (lec is updated). the cpu may clear rxok, txok, and lec, however, writing to the status partition of the control register can never generate or reset an interrupt. to update the intid value the status partition of the control register must be read. 02 message 15 interrupt: bit intpnd in the message control register of message object 15 (last message) has been set. the last message object has the highest interrupt priority of all message objects. 1) (2+n) message n interrupt: bit intpnd in the message control register of message object n has been set (n = 1...14). 1) 2) figure 63 : bit timing definition seg tseg1 tseg2 1 bit time 1 time quantum sample point transmit point sync seg sync
st10f280 123/186 bit timing register (ef04h/ee04h) xreg reset value: uuuuh note this register can only be written, if the configuration change enable bit (cce) is set. mask registers messages can use standard or extended identifiers. incoming frames are masked with their appropriate global masks. bit ide of the incoming message determines whether the standard 11 bit mask in global mask short or the 29 bit extended mask in global mask long is to be used. bit holding a 0 mean dont care, so do not compare the messages identifier in the respective bit position. the last message object (15) has an additional individually programmable acceptance mask (mask of last message) for the complete arbitration field. this allows classes of messages to be received in this object by masking some bits of the identifier. note the mask of last message is anded with the global mask that corresponds to the incoming message. global mask short (ef06h/ee06h) xreg reset value: ufuuh upper global mask long (ef08h/ee08h) xreg reset value: uuuuh 1514131211109876543210 0 tseg2 tseg1 sjw brp rrw rw rw rw bit function brp baud rate prescaler for generating the bit time quanta the cpu frequency is divided by 2 x (brp+1). sjw (re)synchronization jump width adjust the bit time by maximum (sjw+1) time quanta for re-synchronization. tseg1 time segment before sample point there are (tseg1+1) time quanta before the sample point. valid values for tseg1 are 2...15. tseg2 time segment after sample point there are (tseg2+1) time quanta after the sample point. valid values for tseg2 are 1...7. 1514131211109876543210 id20...18 11111 id 28...21 rw rrrrr rw bit function id28...18 identifier (11 bit) mask to filter incoming messages with standard identifier. 1514131211109876543210 id20...13 id28...21 rw rw
st10f280 124/186 lower global mask long (ef0ah/ee0ah) xreg reset value: uuuuh upper mask of last message (ef0ch/ee0ch) xreg reset value: uuuuh lower mask of last message (ef0eh/ee0eh) xreg reset value: uuuuh 15.5 - the message object the message object is the primary means of communication between cpu and can controller. each of the 15 message objects uses 15 consecutive bytes (see figure 64) and starts at an address that is a multiple of 16. note all message objects must be initialized by the cpu, even those which are not going to be used, before clearing the init bit. each element of the message control register is made of two complementary bits. this special mechanism allows the selective setting or resetting of specific elements (leaving others unchanged) without requiring read-modify-write cycles. none of these elements will be affected by reset. the table 29 shows how to use and to interpret these 2 bit-fields. 1514131211109876543210 id4...0 0 0 0 id12...5 rw r r r rw bit function id28...0 identifier (29 bit) mask to filter incoming messages with extended identifier. 1514131211109876543210 id20...18 id17...13 id28...21 rw rw rw 1514131211109876543210 id4...0 0 0 0 id12...5 rw r r r rw bit function id28...0 identifier (29 bit) mask to filter the last incoming message (nr. 15) with standard or extended identifier (as configured). figure 64 : message object address map message control arbitration message config. +0 +2 +4 +6 +8 +10 +12 +14 object start address data0 reserved data1 data2 data3 data4 data5 data6 data7 table 29 : functions of complementary bit of message control register value function on write meaning on read 00 reserved reserved 01 reset element element is reset 10 set element element is set 11 leave element unchanged reserved
st10f280 125/186 message control register (efn0h/een0h) xreg reset value: uuuuh notes 1. in message object 15 (last message) these bits are hardwired to 0 (inactive) in order to prevent transmission of mess age 15. 2. when the can controller writes new data into the message object, unused message bytes will be overwritten by non specified values. usually the cpu will clear this bit before working on the data, and verify that the bit is still cleared once it has fi nished working to ensure that it has worked on a consistent set of data and not part of an old message and part of the new message. for transmit-objects the cpu will set this bit along with clearing bit cpuupd. this will ensure that, if the message is actuall y being transmitted during the time the message was being updated by the cpu, the can controller will not reset bit txrq. in this way b it txrq is only reset once the actual data has been transferred. 3. when the cpu requests the transmission of a receive-object, a remote frame will be sent instead of a data frame to request a remote node to send the corresponding data frame. this bit will be cleared by the can controller along with bit rmtpnd when the message has been successfully transmitted, if bit newdat has not been set. if there are several valid message objects with pend ing transmission request, the message with the lowest message number is transmitted first. 1514131211109876543210 rmtpnd txrq msglst cpuupd newdat msgval txie rxie intpnd rw rw rw rw rw rw rw rw bit function intpnd interrupt pending indicates, if this message object has generated an interrupt request (see txie and rxie), since this bit was last reset by the cpu, or not. rxie receive interrupt enable defines, if bit intpnd is set after successful reception of a frame. txie transmit interrupt enable defines, if bit intpnd is set after successful transmission of a frame. 1 msgval message valid indicates, if the corresponding message object is valid or not. the can controller only operates on valid objects. message objects can be tagged invalid, while they are changed, or if they are not used at all. newdat new data indicates, if new data has been written into the data portion of this message object by cpu (transmit-objects) or can controller (receive-objects) since this bit was last reset, or not. 2 msglst (receive) message lost (this bit applies to receive -objects only) indicates that the can controller has stored a new message into this object, while newdat was still set, i.e. the previously stored message is lost. cpuupd (transmit) cpu update (this bit applies to transmit -objects only) indicates that the corresponding message object may not be transmitted now. the cpu sets this bit in order to inhibit the transmission of a message that is currently updated, or to control the automatic response to remote requests. txrq transmit request indicates that the transmission of this message object is requested by the cpu or via a remote frame and is not yet done. txrq can be disabled by cpuupd. 1 3 rmtpnd remote pending (used for transmit-objects) indicates that the transmission of this message object has been requested by a remote node, but the data has not yet been transmitted. when rmtpnd is set, the can controller also sets txrq. rmtpnd and txrq are cleared, when the message object has been successfully transmitted.
st10f280 126/186 15.6 - arbitration registers the arbitration registers are used for acceptance filtering of incoming messages and to define the identifier of outgoing messages. upper arbitration reg (efn2h/een2h) xreg reset value: uuuuh lower arbitration reg (efn4h/een4h) xreg reset value: uuuuh 1514131211109876543210 id20...18 id17...13 id28...21 rw rw rw 1514131211109876543210 id4...0 0 0 0 id12...5 rw r r r rw bit function id28...0 identifier (29 bit) identifier of a standard message (id28...18) or an extended message (id28...0). for standard identifiers bit id17...0 are dont care.
st10f280 127/186 16 - watchdog timer the watchdog timer is a fail-safe mechanism which prevents the microcontroller from malfunc- tioning for long periods of time. the watchdog timer is always enabled after a reset of the chip and can only be disabled in the time interval until the einit (end of initialization) instruction has been executed. therefore, the chip start-up procedure is always monitored. the software must be designed to ser- vice the watchdog timer before it overflows. if, due to hardware or software related failures, the soft- ware fails to do so, the watchdog timer overflows and generates an internal hardware reset. it pulls the rstout pin low in order to allow external hardware components to be reset. each of the different reset sources is indicated in the wdtcon register. the indicated bit are cleared with the einit instruction. the origine of the reset can be identi- fied during the initialization phase. wdtcon (ffaeh / d7h) sfr reset value: 00xxh notes: 1. more than one reset indication flag may be set. after einit, all flags are cleared. 2. power-on is detected when a rising edge from vcc = 0 v to vcc > 2.0 v is recognized. 1514131211109876543210 wdtrel - - ponr lhwr shwr swr wdtr wdtin rw rrrrrrw wdtin watchdog timer input frequency selection 0: input frequency is f cpu /2. 1: input frequency is f cpu /128. wdtr 1 watchdog timer reset indication flag set by the watchdog timer on an overflow. cleared by a hardware reset or by the srvwdt instruction. swr 1 software reset indication flag set by the srst execution. cleared by the einit instruction. shwr 1 short hardware reset indication flag set by the input rstin . cleared by the einit instruction. lhwr 1 long hardware reset indication flag set by the input rstin . cleared by the einit instruction. ponr 1- 2 power-on (asynchronous) reset indication flag set by the input rstin if a power-on condition has been detected. cleared by the einit instruction.
st10f280 128/186 the ponr flag of wdtcon register is set if the output voltage of the internal 3.3v supply falls below the threshold (typically 2v) of the power-on detection circuit. this circuit is efficient to detect major failures of the external 5v supply but if the internal 3.3v supply does not drop under 2 volts, the ponr flag is not set. this could be the case on fast switch-off / switch-on of the 5v supply. the time needed for such a sequence to activate the ponr flag depends on the value of the capacitors connected to the supply and on the exact value of the internal threshold of the detection circuit. notes: 1. ponr bit may not be set for short supply failure. 2. for power-on reset and reset after supply partial failure, asynchronous reset must be used. in case of bi-directional reset is enabled, and if the rstin pin is latched low after the end of the internal reset sequence, then a short hardware reset, a software reset or a watchdog reset will trigger a long hardware reset. thus, reset indications flags will be set to indicate a long hardware reset. the watchdog timer is 16-bit, clocked with the system clock divided by 2 or 128. the high byte of the watchdog timer register can be set to a pre-specified reload value (stored in wdtrel). each time it is serviced by the application software, the high byte of the watchdog timer is reloaded. for security, rewrite wdtcon each time before the watchdog timer is serviced the table 31 shows the watchdog time range for 40mhz cpu clock. the watchdog timer period is calculated with the following formula: table 30 : wdtcon bits value on different resets reset source ponr lhwr shwr swr wdtr power on reset x x x x power on after partial supply failure 1 x x x long hardware reset x x x short hardware reset x x software reset x watchdog reset xx table 31 : wdtrel reload value reload value in wdtrel prescaler for f cpu = 40mhz 2 (wdtin = 0) 128 (wdtin = 1) ffh 12.8 m s 819.2ms 00h 3.276ms 209.7ms p wdt 1 f cpu --------------- 512 1wdtin ] 63 ) 256 w dtrel ]) [ C ( [ + ( =
st10f280 129/186 u n der u pd at i n g 17 - system reset system reset initializes the mcu in a predefined state. there are five ways to activate a reset state. the system start-up configuration is different for each case as shown in table 32. 17.1 - asynchronous reset (long hardware reset) an asynchronous reset is triggered when rstin pin is pulled low while rpd pin is at low level. then the mcu is immediately forced in reset default state. it pulls low rstout pin, it cancels pending internal hold states if any, it waits for any internal access cycles to finish, it aborts external bus cycle, it switches buses (data, address and control signals) and i/o pin drivers to high-impedance, it pulls high port0 pins and the reset sequence starts. power-on reset the asynchronous reset must be used during the power-on of the mcu. depending on crystal fre- quency, the on-chip oscillator needs about 10ms to 50ms to stabilize. the logic of the mcu does not need a stabilized clock signal to detect an asyn- chronous reset, so it is suitable for power-on condi- tions. to ensure a proper reset sequence, the rstin pin and the rpd pin must be held at low level until the mcu clock signal is stabilized and the system configuration value on port0 is settled. hardware reset the asynchronous reset must be used to recover from catastrophic situations of the application. it may be triggerred by the hardware of the applica- tion. internal hardware logic and application cir- cuitry are described in reset circuitry chapter and figures figure 68 :, figure 69 : and figure 70 :. exit of asynchronous reset state when the rstin pin is pulled high, the mcu restarts. the system configuration is latched from port0 and ale, rd and r/w pins are driven to their inactive level. the mcu starts program execution from memory location 00'0000h in code segment 0. this starting location will typically point to the general initialization routine. timing of asynchronous reset sequence are summarized in figure 65. note: 1. rstin rising edge to internal latch of port0 is 3 cpu clock cycles (6 tcl) if the pll is bypassed and the prescaler is on (f cpu =f xtal / 2), else it is 4 cpu clock cycles (8 tcl) . table 32 : reset event definition reset source short-cut conditions power-on reset ponr power-on long hardware reset (synchronous & asynchronous) lhwr t rstin > 1032 tcl short hardware reset (synchronous reset) shwr 4 tcl < t rstin < 1032 tcl watchdog timer reset wdtr wdt overflow software reset swr srst execution figure 65 : asynchronous reset timing 6 tcl or 8 tcl 1 cpu clock rstin asynchronous reset condition rpd rstout ale port0 reset configuration inst #1 internal reset signal latching point of port0 for system start-up configuration
130/186 st10f280 u n der u pd at i n g 17.2 - synchronous reset (warm reset) a synchronous reset is triggered when rstin pin is pulled low while rpd pin is at high level. in order to properly activate the internal reset logic of the mcu, the rstin pin must be held low, at least, during 4 tcl (2 periods of cpu clock). the i/o pins are set to high impedance and rstout pin is driven low. after rstin level is detected, a short duration of 12 tcl (approximately 6 periods of cpu clock) elapes, during which pending internal hold states are cancelled and the current internal access cycle if any is completed. external bus cycle is aborted. the internal pull-down of rstin pin is activated if bit bdrsten of syscon register was previously set by software. this bit is always cleared on power-on or after a reset sequence. exit of synchronous reset state the internal reset sequence starts for 1024 tcl (512 periods of cpu clock) and rstin pin level is sampled. the reset sequence is extended until rstin level becomes high. then, the mcu restarts. the system configuration is latched from port0 and ale, rd and r/w pins are driven to their inactive level. the mcu starts program execution from memory location 00'0000h in code segment 0. this starting location will typically point to the general initialization routine. timing of synchronous reset sequence are summarized in figure 66 and figure 67. notes: 1. rstin assertion can be released there. 2. if during the reset condition (rstin low), v rpd voltage drops below the threshold voltage (about 2.5v for 5v operation), the asynchronous reset is then immediately entered. 3. rstin rising edge to internal latch of port0 is 3 cpu clock cycles (6 tcl) if the pll is bypassed and the prescaler is on (f cpu =f xtal / 2), else it is 4 cpu clock cycles (8 tcl). 4) rstin pin is pulled low if bit bdrsten (bit 5 of syscon register) was previously set by software. bit bdrsten is cleared after reset. figure 66 : synchronous warm reset (short low pulse on rstin ) cpu clock rstin rpd rstout ale port0 inst #1 internal reset signal latching point of port0 for system start-up configuration 6 or 8 tcl 3 4 tcl 12 tcl min. max. 1024 tcl 1 internally pulled low 4 reset configuration v rpd > 2.5v asynchronous reset not entered. 200 m a discharge 2
st10f280 131/186 u n der u pd at i n g figure 67 : synchronous warm reset (long low pulse on rstin) notes: 1. rstin rising edge to internal latch of port0 is 3 cpu (6 tcl) clock cycles if the pll is bypassed and the prescaler is on (f cpu = f xtal / 2), else it is 4 cpu clock cycles (8 tcl). 2. if during the reset condition (rstin low), v rpd voltage drops below the threshold voltage (about 2.5v for 5v operation), the asynchronous reset is then immediately entered. 3. rstin pin is pulled low if bit bdrsten (bit 5 of syscon register) was previously set by soft-ware. bit bdrsten is cleared after reset. 17.3 - software reset the reset sequence can be triggered at any time using the protected instruction srst (software reset). this instruction can be executed deliberately within a program, for example to leave bootstrap loader mode, or upon a hardware trap that reveals a system failure. upon execution of the srst instruction, the internal reset sequence (1024 tcl) is started. the microcontroller behaviour is the same as for a short hardware reset, except that only p0.12...p0.6 bit are latched at the end of the reset sequence, while p0.5...p0.2 bit are cleared. 17.4 - watchdog timer reset when the watchdog timer is not disabled during the initialization or when it is not regularly serviced during program execution it will overflow and it will trigger the reset sequence. unlike hardware and software resets, the watchdog reset completes a running external bus cycle if this bus cycle either does not use ready , or if ready is sampled active (low) after the programmed wait states. when ready is sampled inactive (high) after the programmed wait states the running external bus cycle is aborted. then the internal reset sequence is started. at the end of the internal reset sequence (1024 tcl), only p0.12...p0.6 bit are latched, while previously latched values of p0.5...p0.2 are cleared. 17.5 - rstout pin and bidirectional reset the rstout pin is driven active (low level) at the beginning of any reset sequence (synchronous/ asynchronous hardware, software and watchdog timer resets). rstout pin stays active low beyond the end of the initialization routine, until the protected einit instruction (end of initialization) is completed. the bidirectional reset function is useful when external devices require a reset signal but cannot be connected to rstout pin, because rstout signal lasts during initialisation. it is, for instance, the case of external memory running initialization routine before the execution of einit instruction. bidirectional reset function is enabled by setting bit 3 (bdrsten) in syscon register. it only can be enabled during the initialization routine, before einit instruction is completed. cpu clock rstin rpd rstout ale port0 internal reset signal latching point of port0 for system start-up configuration 6 or 8 tcl 1 4 tcl 12 tcl 1024 tcl internally pulled low 3 reset configuration 2 v rpd > 2.5v asynchronous reset not entered. 200 m a discharge
132/186 st10f280 u n der u pd at i n g when enabled, the open drain of the rstin pin is activated, pulling down the reset signal, for the duration of the internal reset sequence (synchronous/asynchronous hardware, software and watchdog timer resets). at the end of the internal reset sequence the pull down is released and the rstin pin is sampled 8 tcl periods later. C if signal is sampled low, a hardware reset is trig- gered again. C if it is sampled high, the chip exits reset state ac- cording to the running reset way (synchronous/ asynchronous hardware, software and watch- dog timer resets ). note: the bidirectional reset function is disabled by any reset sequence (bit bdrsten of syscon is cleared). to be activated again it must be enabled during the initialization routine. 17.6 - reset circuitry the internal reset circuitry is described in figure 68. an internal pull-up resistor is implemented on rstin pin. (50k w minimum, to 250k w maximum). the minimum reset time must be calculated using the lowest value. in addition, a programmable pull-down (bit bdrsten of syscon register) drives the rstin pin according to the internal reset state as explained in section 17.5 - rstout pin and bidirectional reset. the rstout pin provides a signals to the application as described in section 17.5 - rstout pin and bidirectional reset. a weak internal pull-down is connected to the rpd pin to discharge external capacitor to vss at a rate of 100 m a to 200 m a. this pull-down is turned on when rstin pin is low if bit pwdcfg of syscon register is set, an internal pull-up resistor is activated at the end of the reset sequence. this pull-up charges the capacitor connected to rpd pin. if bidirectional reset function is not used, the simplest way to reset st10f280 is to connect external components as shown in figure 69. it works with reset from application (hardware or manual) and with power-on. the value of c1 capacitor, connected on rstin pin with internal pull-up resistor (50k w to 250k w ), must lead to a charging time long enough to let the internal or external oscillator and / or the on-chip pll to stabilize. the r0-c0 components on rpd pin are mainly implemented to provide a time delay to exit power down mode (see chapter 18 - power reduction modes). nervertheless, they drive rpd pin level during resets and they lead to different reset modes as explained hereafter. on power-on, c0 is totaly discharged, a low level on rpd pin forces an asynchronous hardware reset. c0 capacitor starts to charge throught r0 and at the end of reset sequence st10f280 restarts. rpd pin threshold is typically 2.5v. depending on the delay of the next applied reset, the mcu can enter a synchronous reset or an asynchronous reset. if rpd pin is below 2.5v an asynchronous reset starts, if rpd pin is above 2.5v a synchronous reset starts. (see section 17.1 - asynchronous reset (long hardware reset) and section 17.2 - synchronous reset (warm reset)). note that an internal pull-down is connected to rpd pin and can drive a 100 m a to 200 m a current. this pull-down is turned on when rstin pin is low. in order to properly use the bidirectional reset features, the schematic (or equivalent) of figure 70 must be implemented. r1-c1 only work for power-on or manual reset in the same way as explained previously. d1 diode brings a faster discharge of c1 capacitor at power-off during repetitive switch-on / switch-off sequences. d2 diode performs an or-wired connection, it can be replaced with an open drain buffer. r2 resistor may be added to increase the pull-up current to the open drain in order to get a faster rise time on rstin pin when bidirectional function is activated. the start-up configurations and some system features are selected on reset sequences as described in table 33 and table 34. table 33 describes what is the system configuration latched on port0 in the five different reset ways. table 34 summarizes the bit state of port0 latched in rp0h, syscon, buscon0 registers. rpoh register is described in section 19.2 - system configuration registers.
st10f280 133/186 u n der u pd at i n g figure 68 : internal (simplified) reset circuitry. rstout einit instruction trigger clr clock reset state machine internal reset signal reset sequence (512 cpu clock cycles) srst instruction watchdog overflow rstin v cc bdrsten v cc rpd weak pull-down (~200 m a) from/to exit powerdown circuit asynchronous reset clr q set figure 69 : minimum external reset circuitry st10f280 external hardware rstout + rstin a) manual hardware reset c1 b) for automatic power-up reset and interruptible power-down mode v dd r0 rpd + c0
134/186 st10f280 u n der u pd at i n g table 33 : port0 latched configuration for the different resets notes: 1. not latched from port0. 2. only rp0h low byte is used and the bit-fields are latched from port0 high byte to rp0h low byte. 3. indirectly depend on port0. 4. bits set if ea pin is 1. figure 70 : external reset hardware circuitry x : pin is sampled - : pin is not sampled port0 clock options segm. addr. lines chip selects wr config. bus type reserved bsl reserved reserved adapt mode emu mode sample event p0h.7 p0h.6 p0h.5 p0h.4 p0h.3 p0h.2 p0h.1 p0h.0 p0l.7 p0l.6 p0l.5 p0l.4 p0l.3 p0l.2 p0l.1 p0l.0 software reset - - - xxxxxxx ------ watchdog reset - - - xxxxxxx ------ short hardware reset - - - xxxxxxxxxxxxx long hardware reset xxxxxxxxxxxxxxxx power-on reset xxxxxxxxxxxxxxxx table 34 : port0 bit latched into the different registers after reset port0 bit nber h7 h6 h5 h4 h3 h2 h1 h0 i7 i6 i5 i4 i3 i2 i1 i0 port0 bit name clkcfg clkcfg clkcfg salsel salsel cssel cssel wrc bustyp bustyp r bsl r r adp emu rp0h 2 x 1 x 1 x 1 x 1 x 1 x 1 x 1 x 1 clkcfg clkcfg clkcfg salsel salsel cssel cssel wrc syscon x 1 x 1 x 1 x 1 x 1 x 1 bytdis 3 x 1 wrcfg 3 x 1 x 1 x 1 x 1 x 1 x 1 x 1 buscon0 x 1 x 1 x 1 x 1 -bus act0 4 ale ctl0 4 - btyp btyp x 1 x 1 x 1 x 1 x 1 x 1 internal logic to clock generator to port 4 logic to port 6 logic x 1 x 1 x 1 x 1 internal x 1 x 1 internal internal st10f280 external hardware rstout + rstin v dd c1 d2 r1 d1 v dd r2 open drain inverter external reset source v dd r0 rpd + c0
st10f280 135/186 18 - power reduction modes two different power reduction modes with differ- ent levels of power reduction have been imple- mented in the st10f280, which may be entered under software control. in idle mode the cpu is stopped, while the peripherals continue their operation. idle mode can be terminated by any reset or interrupt request. in power down mode both the cpu and the peripherals are stopped. power down mode can now be configured by software in order to be ter- minated only by a hardware reset or by a transi- tion on enabled fast external interrupt pins. note: all external bus actions are completed before idle or power down mode is entered. however, idle or power down mode is not entered if ready is enabled, but has not been activated (driven low for negative polarity, or driven high for positive polarity) during the last bus access. 18.1 - idle mode idle mode is entered by running idle protected instruction. the cpu operation is stopped and the peripherals still run. idle mode is terminate by any interrupt request. whatever the interrupt is serviced or not, the instruction following the idle instruction will be executed after return from interrupt (reti) instruction, then the cpu resumes the normal program. note that a pec transfer keep the cpu in idle mode. if the pec transfer does not succeed, the idle mode is terminated. watchdog timer must be properly programmed to avoid any disturbance during idle mode. 18.2 - power down mode power down mode starts by running pwrdn protected instruction. internal clock is stopped, all mcu parts are on hold including the watchdog timer. there are two different operating power down modes : protected mode and interruptible mode. the internal ram contents can be preserved through the voltage supplied via the v dd pins. to verify ram integrity, some dedicated patterns may be written before entering the power down mode and have to be checked after power down is resumed. it is mandatory to keep v dd = +5v 10% during power-down mode, because the on-chip voltage regulator is turned in power saving mode and it delivers 2.5v to the core logic, but it must be supplied at nominal v dd = +5v. syscon (ff12h / 89h) sfr reset value: 0xx0h note: register syscon cannot be changed after execution of the einit instruction. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stksz rom s1 sgt dis rom en byt dis clk en wr cfg cs cfg pwd- cfg owd- dis bdr sten xpen visi ble xper- share rw rw rw rw rw rw rw rw rw rw rw rw rw rw bit function pwdcfg 0 1 power down mode configuration control power down mode can only be entered during pwrdn instruction execution if nmi pin is low, oth- erwise the instruction has no effect. to exit power down mode, an external reset must occurs by asserting the rstin pin. power down mode can only be entered during pwrdn instruction execution if all enabled fas- texternal interrupt (exxin) pins are in their inactive level. exiting this mode can be done by asserting one enabled exxin pin.
st10f280 136/186 18.2.1 - protected power down mode this mode is selected by clearing the bit pwd- cfg in register syscon to 0. in this mode, the power down mode can only be entered if the nmi (non maskable interrupt) pin is externally pulled low while the pwrdn instruction is executed. this feature can be used in conjunction with an external power failure signal which pulls the nmi pin low when a power failure is imminent. the microcontroller will enter the nmi trap routine which can save the internal state into ram. after the internal state has been saved, the trap routine may set a flag or write a certain bit pattern into specific ram locations, and then execute the pwrdn instruction. if the nmi pin is still low at this time, power down mode will be entered, oth- erwise program execution continues. during power down the voltage delivered by the on-chip voltage regulator automatically lowers the internal logic supply down to 2.5 v, saving the power while the contents of the internal ram and all registers will still be preserved. exiting power down mode in this mode, the only way to exit power down mode is with an external hardware reset. the initialization routine (executed upon reset) can check the identification flag or bit pattern within ram to determine whether the controller was initially switched on, or whether it was prop- erly restarted from power down mode. 18.2.2 - interruptable power down mode this mode is selected by setting the bit bit pwd- cfg in register syscon to 1. in this mode, the power down mode can be entered if enabled fast external interrupt pins (exxin pins, alternate functions of port 2 pins, with x = 7...0) are in their inactive level. this inac- tive level is configured with the exixes bit field in the exicon register, as follow: exicon (f1c0h / e0h) esfr reset value: 0000h 1514131211109876543210 exi7es exi6es exi5es exi4es exi3es exi2es exi1es exi0es rw rw rw rw rw rw rw rw bit function exixes (x=7...0) 00 01 10 11 external interrupt x edge selection field (x=7...0) fast external interrupts disabled: standard mode exxin pin not taken in account for entering/exiting power down mode. interrupt on positive edge (rising) enter power down mode if exiin = 0, exit if exxin = 1 (referred as high active level) interrupt on negative edge (falling) enter power down mode if exiin = 1, exit if exxin = 0 (referred as low active level) interrupt on any edge (rising or falling) always enter power down mode, exit if exxin level changed.
st10f280 137/186 exiting power down mode when power down mode is entered, the cpu and peripheral clocks are frozen, and the oscillator and pll are stopped. power down mode can be exited by either asserting rstin or one of the enabled exxin pin (fast external interrupt). rstin must be held low until the oscillator and pll have stabilized. exxin inputs are normally sampled interrupt inputs. however, the power down mode circuitry uses them as level-sensitive inputs. an exxin (x = 7...0) interrupt enable bit (bit ccxie in respective ccxic register) need not to be set to bring the device out of power down mode. an external rc circuit must be connected, as shown in the follow- ing figure: to exit power down mode with external interrupt, an exxin pin has to be asserted for at least 40 ns (x = 7...0). this signal enables the internal oscilla- tor and pll circuitry, and also turns on the weak pull-down (see following figure). the discharging of the external capacitor provides a delay that allows the oscillator and pll circuits to stabilize before the internal cpu and peripheral clocks are enabled. when the vpp voltage drops below the threshold voltage (about 2.5 v), the schmitt trig- ger clears q2 flip-flop, thus enabling the cpu and peripheral clocks, and the device resumes code execution. if the interrupt was enabled (bit ccxie=1 in the respective ccxic register) before entering power down mode, the device executes the interrupt ser- vice routine, and then resumes execution after the pwrdn intruction (see note below). if the inter- rupt was disabled, the device executes the instruction following pwrdn instruction, and the interrupt request flag (bit ccxir in the respec- tive ccxic register) remains set until it is cleared by software. note: due to internal pipeline, the instruction that follows the pwrdn intruction is executed before the cpu performs a call of the interrupt service routine when exiting power-down mode. figure 71 : external rc circuit on rpd pin for exiting powerdown mode with external interrup t rpd v dd c0 r0 220k w 1m w typ i ca l 1 m f typical st10f280 + figure 72 : simplified powerdown exit circuitry dq q v dd enter cd external interrupt reset stop pll stop oscillator v dd dq q cd system clock cpu and peripherals clocks rpd v dd pull-up weak pull-down (~ 200 m a) powerdown q1 q2
st10f280 138/186 figure 73 : powerdown exit sequence when using an external interrupt (pll x 2) cpu clk internal external rpd exitpwrd xtal1 interrupt (internal) ~ 2.5 v delay for oscillator/pll stabilization signal powerdown
st10f280 139/186 19 - special function register overview the following table lists all sfrs which are implemented in the st10f280 in alphabetical order. bit-addressable sfrs are marked with the letter b in column name. sfrs within the extended sfr-space (esfrs) are marked with the letter e in column physical address. an sfr can be specified by its individual mnemonic name. depending on the selected addressing mode, an sfr can be accessed via its physical address (using the data page pointers), or via its short 8-bit address (without using the data page pointers). the reset value is defined as following: x : means the full nibble is not defined at reset. x : means some bit of the nibble are not defined at reset. table 35 : special function registers listed by name name physical address 8-bit address description reset value adcic b ff98h cch a/d converter end of conversion interrupt control register - - 00h adcon b ffa0h d0h a/d converter control register 0000h addat fea0h 50h a/d converter result register 0000h addat2 f0a0h e 50h a/d converter 2 result register 0000h addrsel1 fe18h 0ch address select register 1 0000h addrsel2 fe1ah 0dh address select register 2 0000h addrsel3 fe1ch 0eh address select register 3 0000h addrsel4 fe1eh 0fh address select register 4 0000h adeic b ff9ah cdh a/d converter overrun error interrupt control register - - 00h buscon0 b ff0ch 86h bus configuration register 0 0xx0h buscon1 b ff14h 8ah bus configuration register 1 0000h buscon2 b ff16h 8bh bus configuration register 2 0000h buscon3 b ff18h 8ch bus configuration register 3 0000h buscon4 b ff1ah 8dh bus configuration register 4 0000h caprel fe4ah 25h gpt2 capture/reload register 0000h cc0 fe80h 40h capcom register 0 0000h cc0ic b ff78h bch capcom register 0 interrupt control register - - 00h cc1 fe82h 41h capcom register 1 0000h cc1ic b ff7ah bdh capcom register 1 interrupt control register - - 00h cc2 fe84h 42h capcom register 2 0000h cc2ic b ff7ch beh capcom register 2 interrupt control register - - 00h cc3 fe86h 43h capcom register 3 0000h cc3ic b ff7eh bfh capcom register 3 interrupt control register - - 00h cc4 fe88h 44h capcom register 4 0000h cc4ic b ff80h c0h capcom register 4 interrupt control register - - 00h cc5 fe8ah 45h capcom register 5 0000h cc5ic b ff82h c1h capcom register 5 interrupt control register - - 00h cc6 fe8ch 46h capcom register 6 0000h
st10f280 140/186 cc6ic b ff84h c2h capcom register 6 interrupt control register - - 00h cc7 fe8eh 47h capcom register 7 0000h cc7ic b ff86h c3h capcom register 7 interrupt control register - - 00h cc8 fe90h 48h capcom register 8 0000h cc8ic b ff88h c4h capcom register 8 interrupt control register - - 00h cc9 fe92h 49h capcom register 9 0000h cc9ic b ff8ah c5h capcom register 9 interrupt control register - - 00h cc10 fe94h 4ah capcom register 10 0000h cc10ic b ff8ch c6h capcom register 10 interrupt control register - - 00h cc11 fe96h 4bh capcom register 11 0000h cc11ic b ff8eh c7h capcom register 11 interrupt control register - - 00h cc12 fe98h 4ch capcom register 12 0000h cc12ic b ff90h c8h capcom register 12 interrupt control register - - 00h cc13 fe9ah 4dh capcom register 13 0000h cc13ic b ff92h c9h capcom register 13 interrupt control register - - 00h cc14 fe9ch 4eh capcom register 14 0000h cc14ic b ff94h cah capcom register 14 interrupt control register - - 00h cc15 fe9eh 4fh capcom register 15 0000h cc15ic b ff96h cbh capcom register 15 interrupt control register - - 00h cc16 fe60h 30h capcom register 16 0000h cc16ic b f160h e b0h capcom register 16 interrupt control register - - 00h cc17 fe62h 31h capcom register 17 0000h cc17ic b f162h e b1h capcom register 17 interrupt control register - - 00h cc18 fe64h 32h capcom register 18 0000h cc18ic b f164h e b2h capcom register 18 interrupt control register - - 00h cc19 fe66h 33h capcom register 19 0000h cc19ic b f166h e b3h capcom register 19 interrupt control register - - 00h cc20 fe68h 34h capcom register 20 0000h cc20ic b f168h e b4h capcom register 20 interrupt control register - - 00h cc21 fe6ah 35h capcom register 21 0000h cc21ic b f16ah e b5h capcom register 21 interrupt control register - - 00h cc22 fe6ch 36h capcom register 22 0000h cc22ic b f16ch e b6h capcom register 22 interrupt control register - - 00h cc23 fe6eh 37h capcom register 23 0000h cc23ic b f16eh e b7h capcom register 23 interrupt control register - - 00h cc24 fe70h 38h capcom register 24 0000h table 35 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 141/186 cc24ic b f170h e b8h capcom register 24 interrupt control register - - 00h cc25 fe72h 39h capcom register 25 0000h cc25ic b f172h e b9h capcom register 25 interrupt control register - - 00h cc26 fe74h 3ah capcom register 26 0000h cc26ic b f174h e bah capcom register 26 interrupt control register - - 00h cc27 fe76h 3bh capcom register 27 0000h cc27ic b f176h e bbh capcom register 27 interrupt control register - - 00h cc28 fe78h 3ch capcom register 28 0000h cc28ic b f178h e bch capcom register 28 interrupt control register - - 00h cc29 fe7ah 3dh capcom register 29 0000h cc29ic b f184h e c2h capcom register 29 interrupt control register - - 00h cc30 fe7ch 3eh capcom register 30 0000h cc30ic b f18ch e c6h capcom register 30 interrupt control register - - 00h cc31 fe7eh 3fh capcom register 31 0000h cc31ic b f194h e cah capcom register 31 interrupt control register - - 00h ccm0 b ff52h a9h capcom mode control register 0 0000h ccm1 b ff54h aah capcom mode control register 1 0000h ccm2 b ff56h abh capcom mode control register 2 0000h ccm3 b ff58h ach capcom mode control register 3 0000h ccm4 b ff22h 91h capcom mode control register 4 0000h ccm5 b ff24h 92h capcom mode control register 5 0000h ccm6 b ff26h 93h capcom mode control register 6 0000h ccm7 b ff28h 94h capcom mode control register 7 0000h cp fe10h 08h cpu context pointer register fc00h cric b ff6ah b5h gpt2 caprel interrupt control register - - 00h csp fe08h 04h cpu code segment pointer register (read only) 0000h dp0l b f100h e 80h p0l direction control register - - 00h dp0h b f102h e 81h p0h direction control register - - 00h dp1l b f104h e 82h p1l direction control register - - 00h dp1h b f106h e 83h p1h direction control register - - 00h dp2 b ffc2h e1h port 2 direction control register 0000h dp3 b ffc6h e3h port 3 direction control register 0000h dp4 b ffcah e5h port 4 direction control register - - 00h dp6 b ffceh e7h port 6 direction control register - - 00h dp7 b ffd2h e9h port 7 direction control register - - 00h dp8 b ffd6h ebh port 8 direction control register - - 00h table 35 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 142/186 dpp0 fe00h 00h cpu data page pointer 0 register (10-bit) 0000h dpp1 fe02h 01h cpu data page pointer 1 register (10-bit) 0001h dpp2 fe04h 02h cpu data page pointer 2 register (10-bit) 0002h dpp3 fe06h 03h cpu data page pointer 3 register (10-bit) 0003h exicon b f1c0h e e0h external interrupt control register 0000h exisel b f1dah e edh external interrupt source selection register 0000h idchip f07ch e 3eh device identifier register (n is the device revision) 118nh idmanuf f07eh e 3fh manufacturer identifier register 0401h idmem f07ah e 3dh on-chip memory identifier register 3080h idprog f078h e 3ch programming voltage identifier register 0040h idx0 b ff08h 84h mac unit address pointer 0 0000h idx1 b ff0ah 85h mac unit address pointer 1 0000h mah fe5eh 2fh mac unit accumulator - high word 0000h mal fe5ch 2eh mac unit accumulator - low word 0000h mcw b ffdch eeh mac unit control word 0000h mdc b ff0eh 87h cpu multiply divide control register 0000h mdh fe0ch 06h cpu multiply divide register C high word 0000h mdl fe0eh 07h cpu multiply divide register C low word 0000h mrw b ffdah edh mac unit repeat word 0000h msw b ffdeh efh mac unit status word 0200h odp2 b f1c2h e e1h port 2 open drain control register 0000h odp3 b f1c6h e e3h port 3 open drain control register 0000h odp4 b f1cah e e5h port 4 open drain control register - - 00h odp6 b f1ceh e e7h port 6 open drain control register - - 00h odp7 b f1d2h e e9h port 7 open drain control register - - 00h odp8 b f1d6h e ebh port 8 open drain control register - - 00h ones b ff1eh 8fh constant value 1s register (read only) ffffh p0l b ff00h 80h port0 low register (lower half of port0) - - 00h p0h b ff02h 81h port0 high register (upper half of port0) - - 00h p1l b ff04h 82h port1 low register (lower half of port1) - - 00h p1h b ff06h 83h port1 high register (upper half of port1) - - 00h p2 b ffc0h e0h port 2 register 0000h p3 b ffc4h e2h port 3 register 0000h p4 b ffc8h e4h port 4 register (8-bit) - - 00h p5 b ffa2h d1h port 5 register (read only) xxxxh p6 b ffcch e6h port 6 register (8-bit) - - 00h table 35 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 143/186 p7 b ffd0h e8h port 7 register (8-bit) - - 00h p8 b ffd4h eah port 8 register (8-bit) - - 00h p5didis b ffa4h d2h port 5 digital disable register 0000h pocon0l f080h e 40h port0 low outpout control register (8-bit) - - 00h pocon0h f082h e 41h port0 high output control register (8-bit) - - 00h pocon1l f084h e 42h port1 low output control register (8-bit) - - 00h pocon1h f086h e 43h port1 high output control register (8-bit) - - 00h pocon2 f088h e 44h port2 output control register 0000h pocon3 f08ah e 45h port3 output control register 0000h pocon4 f08ch e 46h port4 output control register (8-bit) - - 00h pocon6 f08eh e 47h port6 output control register (8-bit) - - 00h pocon7 f090h e 48h port7 output control register (8-bit) - - 00h pocon8 f092h e 49h port8 output control register (8-bit) - - 00h pocon20 f0aah e 55h ale, rd , wr output control register (8-bit) - - 00h pecc0 fec0h 60h pec channel 0 control register 0000h pecc1 fec2h 61h pec channel 1 control register 0000h pecc2 fec4h 62h pec channel 2 control register 0000h pecc3 fec6h 63h pec channel 3 control register 0000h pecc4 fec8h 64h pec channel 4 control register 0000h pecc5 fecah 65h pec channel 5 control register 0000h pecc6 fecch 66h pec channel 6 control register 0000h pecc7 feceh 67h pec channel 7 control register 0000h picon b f1c4h e e2h port input threshold control register - - 00h pp0 f038h e 1ch pwm module period register 0 0000h pp1 f03ah e 1dh pwm module period register 1 0000h pp2 f03ch e 1eh pwm module period register 2 0000h pp3 f03eh e 1fh pwm module period register 3 0000h psw b ff10h 88h cpu program status word 0000h pt0 f030h e 18h pwm module up/down counter 0 0000h pt1 f032h e 19h pwm module up/down counter 1 0000h pt2 f034h e 1ah pwm module up/down counter 2 0000h pt3 f036h e 1bh pwm module up/down counter 3 0000h pw0 fe30h 18h pwm module pulse width register 0 0000h pw1 fe32h 19h pwm module pulse width register 1 0000h pw2 fe34h 1ah pwm module pulse width register 2 0000h pw3 fe36h 1bh pwm module pulse width register 3 0000h table 35 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 144/186 pwmcon0 b ff30h 98h pwm module control register 0 0000h pwmcon1 b ff32h 99h pwm module control register 1 0000h pwmic b f17eh e bfh pwm module interrupt control register - - 00h qr0 f004h e 02h mac unit offset register qr0 0000h qr1 f006h e 03h mac unit offset register qr1 0000h qx0 f000h e 00h mac unit offset register qx0 0000h qx1 f002h e 01h mac unit offset register qx1 0000h rp0h b f108h e 84h system start-up configuration register (read only) - - xxh s0bg feb4h 5ah serial channel 0 baud rate generator reload register 0000h s0con b ffb0h d8h serial channel 0 control register 0000h s0eic b ff70h b8h serial channel 0 error interrupt control register - - 00h s0rbuf feb2h 59h serial channel 0 receive buffer register (read only) - - xxh s0ric b ff6eh b7h serial channel 0 receive interrupt control register - - 00h s0tbic b f19ch e ceh serial channel 0 transmit buffer interrupt control register - - 00h s0tbuf feb0h 58h serial channel 0 transmit buffer register (write only) 0000h s0tic b ff6ch b6h serial channel 0 transmit interrupt control register - - 00h sp fe12h 09h cpu system stack pointer register fc00h sscbr f0b4h e 5ah ssc baud rate register 0000h ssccon b ffb2h d9h ssc control register 0000h ssceic b ff76h bbh ssc error interrupt control register - - 00h sscrb f0b2h e 59h ssc receive buffer (read only) xxxxh sscric b ff74h bah ssc receive interrupt control register - - 00h ssctb f0b0h e 58h ssc transmit buffer (write only) 0000h ssctic b ff72h b9h ssc transmit interrupt control register - - 00h stkov fe14h 0ah cpu stack overflow pointer register fa00h stkun fe16h 0bh cpu stack underflow pointer register fc00h syscon b ff12h 89h cpu system configuration register 0xx0h 1) t0 fe50h 28h capcom timer 0 register 0000h t01con b ff50h a8h capcom timer 0 and timer 1 control register 0000h t0ic b ff9ch ceh capcom timer 0 interrupt control register - - 00h t0rel fe54h 2ah capcom timer 0 reload register 0000h t1 fe52h 29h capcom timer 1 register 0000h t1ic b ff9eh cfh capcom timer 1 interrupt control register - - 00h t1rel fe56h 2bh capcom timer 1 reload register 0000h t2 fe40h 20h gpt1 timer 2 register 0000h t2con b ff40h a0h gpt1 timer 2 control register 0000h table 35 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 145/186 notes: 1. the system configuration is selected during reset. 2. bit wdtr indicates a watchdog timer triggered reset. 3. the xpnic interrupt control registers control interrupt requests from integrated x-bus peripherals. some software controlled interrupt requests may be generated by setting the xpnir bits (of xpnic register) of the unused x-peripheral nodes. t2ic b ff60h b0h gpt1 timer 2 interrupt control register - - 00h t3 fe42h 21h gpt1 timer 3 register 0000h t3con b ff42h a1h gpt1 timer 3 control register 0000h t3ic b ff62h b1h gpt1 timer 3 interrupt control register - - 00h t4 fe44h 22h gpt1 timer 4 register 0000h t4con b ff44h a2h gpt1 timer 4 control register 0000h t4ic b ff64h b2h gpt1 timer 4 interrupt control register - - 00h t5 fe46h 23h gpt2 timer 5 register 0000h t5con b ff46h a3h gpt2 timer 5 control register 0000h t5ic b ff66h b3h gpt2 timer 5 interrupt control register - - 00h t6 fe48h 24h gpt2 timer 6 register 0000h t6con b ff48h a4h gpt2 timer 6 control register 0000h t6ic b ff68h b4h gpt2 timer 6 interrupt control register - - 00h t7 f050h e 28h capcom timer 7 register 0000h t78con b ff20h 90h capcom timer 7 and 8 control register 0000h t7ic b f17ah e beh capcom timer 7 interrupt control register - - 00h t7rel f054h e 2ah capcom timer 7 reload register 0000h t8 f052h e 29h capcom timer 8 register 0000h t8ic b f17ch e bfh capcom timer 8 interrupt control register - - 00h t8rel f056h e 2bh capcom timer 8 reload register 0000h tfr b ffach d6h trap flag register 0000h wdt feaeh 57h watchdog timer register (read only) 0000h wdtcon b ffaeh d7h watchdog timer control register 00xxh 2) xp0ic b f186h e c3h can1 module interrupt control register - - 00h 3) xp1ic b f18eh e c7h can2 module interrupt control register - - 00h 3) xp2ic b f196h e cbh xpwm interrupt control register - - 00h 3) xp3ic b f19eh e cfh pll unlock interrupt control register - - 00h 3) xpercon f024h e 12h xper configuration register - - 05h zeros b ff1ch 8eh constant value 0s register (read only) 0000h table 35 : special function registers listed by name (continued) name physical address 8-bit address description reset value
st10f280 146/186 table 36 : x registers listed by name name physical address description reset value can1btr ef04h can1 bit timing register xxxxh can1csr ef00h can1 control/status register xx01h can1gms ef06h can1 global mask short xfxxh can1ir ef02h can1 interrupt register - - xxh can1lar1--15 ef14--eff4h can1 lower arbitration register 1 to 15 xxxxh can1lgml ef0ah can1 lower global mask long xxxxh can1lmlm ef0eh can1 lower mask last message xxxxh can1mcr1--15 ef10--eff0h can1 message control register 1 to 15 xxxxh can1mo1--15 ef1x--effxh can1 message object 1 to 15 xxxxh can1uar1--15 ef12--eff2h can1 upper arbitration register 1 to 15 xxxxh can1ugml ef08h can1 upper global mask long xxxxh can1umlm ef0ch can1 upper mask last message xxxxh can2btr ee04h can2 bit timing register xxxxh can2csr ee00h can2 control/status register xx01h can2gms ee06h can2 global mask short xfxxh can2ir ee02h can2 interrupt register - - xxh can2lar1--15 ee14--eef4h can2 lower arbitration register 1 to 15 xxxxh can2lgml ee0ah can2 lower global mask long xxxxh can2lmlm ee0eh can2 lower mask last message xxxxh can2mcr1--15 ee10--eef0h can2 message control register 1 to 15 xxxxh can2mo1--15 ee1x--eefxh can2 message object 1 to 15 xxxxh can2uar1--15 ee12--eef2h can2 upper arbitration register 1 to 15 xxxxh can2ugml ee08h can2 upper global mask long xxxxh can2umlm ee0ch can2 upper mask last message xxxxh xadcmux c384h port5 or portx10 adc input selection (read / write) 0000h xdp9 c200h direction register xport9 (read / write) 0000h xdp9clr c204h bit clear direction register xport9 (write only) 0000h xdp9set c202h bit set direction register xport9 (write only) 0000h xodp9 c300h open drain control register xport9 (read / write) 0000h xodp9clr c304h bit clear open drain control register xport9 (write only) 0000h xodp9set c302h bit set open drain control register xport9 (write only) 0000h xp10 c380h read only data register xport10 (read only) 0000h xp10didis c382h xport10 schmitt trigger input selection (read / write) 0000h xp9 c100h data register xport9 (read / write) 0000h xp9clr c104h bit clear data register xport9 (write only) 0000h xp9set c102h bit set data register xport9 (write only) 0000h
st10f280 147/186 xpolar ec04h xpwm channel polarity control register 0000h xpp0 ec20h xpwm period register 0 0000h xpp1 ec22h xpwm period register 1 0000h xpp2 ec24h xpwm period register 2 0000h xpp3 ec26h xpwm period register 3 0000h xpt0 ec10h xpwm timer counter register 0 0000h xpt1 ec12h xpwm timer counter register 1 0000h xpt2 ec14h xpwm timer counter register 2 0000h xpt3 ec16h xpwm timer counter register 3 0000h xpw0 ec30h xpwm pulse width register 0 0000h xpw1 ec32h xpwm pulse width register 1 0000h xpw2 ec34h xpwm pulse width register 2 0000h xpw3 ec36h xpwm pulse width register 3 0000h xpwmcon0 ec00h xpwm control register 0 0000h xpwmcon1 ec02h xpwm control register 1 0000h xtcr c000h xtimer control register (read / write) 0000h xtcvr c006h xtimer current value register (read / write) 0000h xtevr c004h xtimer end value register (read / write) 0000h xtsvr c002h xtimer start value register (read / write) 0000h name physical address description reset value
st10f280 148/186 19.1 - identification registers the st10f280 has four identification registers, mapped in esfr space. these register contain: C a manufacturer identifier, C a chip identifier, with its revision, C a internal memory and size identifier and programming voltage description. idmanuf (f07eh / 3fh) 1 esfr reset value: 0401h idchip (f07ch / 3eh) 1 esfr reset value: 118xh idmem (f07ah / 3dh) 1 esfr reset value: 3080h idprog (f078h / 3ch) 1 esfr reset value: 0040h note : 1. all identification words are read only registers. 1514131211109876543210 manuf 00001 r manuf manufacturer identifier 020h: stmicroelectronics manufacturer (jtag worldwide normalisation). 1514131211109876543210 chipid revid rr revid device revision identifier chipid device identifier 118h: st10f280 identifier. 15 14131211109876543210 memtyp memsize rr memsize internal memory size is calculated using the following formula: size = 4 x [memsize] (in k byte) 080h for st10f280 (512k byte) memtyp internal memory type 3h for st10f280 (flash memory). 1514131211109876543210 progvpp progvdd rr progvdd programming v dd voltage v dd voltage when programming eprom or flash devices is calculated using the following formula: v dd = 20 x [progvdd] / 256 (volts) 40h for st10f280 (5v). progvpp programming v pp voltage (no need of external v pp ) 00h
st10f280 149/186 19.2 - system configuration registers the st10f280 has registers used for different configuration of the overall system. these registers are described below. syscon (ff12h / 89h) sfr reset value: 0xx0h notes: 1. these bit are set directly or indirectly according to port0 and ea pin configuration during reset sequence. 2. register syscon cannot be changed after execution of the einit instruction. 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 stksz roms1 sgtdis romen bytdis clken wrcfg cscfg pwd cfg owd dis bdr sten xpen visible xper- share rw rw rw rw 1 rw 1 rw rw 1 rw rw rw rw rw rw rw xper-share xbus peripheral share mode control 0: external accesses to xbus peripherals are disabled 1: xbus peripherals are accessible via the external bus during hold mode visible visible mode control 0: accesses to xbus peripherals are done internally 1: xbus peripheral accesses are made visible on the external pins xpen xbus peripheral enable bit 0: accesses to the on-chip x-peripherals and xram are disabled 1: the on-chip x-peripherals are enabled. bdrsten bidirectional reset enable 0: rstin pin is an input pin only. (sw reset or wdt reset have no effect on this pin) 1: rstin pin is a bidirectional pin. this pin is pulled low during 1024 tcl during reset sequence. owddis oscillator watchdog disable control 0: oscillator watchdog (owd) is enabled. if pll is bypassed, the owd monitors xtal1 activity. if there is no activity on xtal1 for at least 1 m s, the cpu clock is switched automatically to plls base frequency (2 to 10mhz). 1: owd is disabled. if the pll is bypassed, the cpu clock is always driven by xtal1 signal. the pll is turned off to reduce power supply current. pwdcfg power down mode configuration control 0: power down mode can only be entered during pwrdn instruction execution if nmi pin is low, otherwise the instruction has no effect. exit power down only with reset. 1: power down mode can only be entered during pwrdn instruction execution if all enabled fast external interrupt exxin pins are in their inactive level. exiting this mode can be done by asserting one enabled exxin pin or with external reset. cscfg chip select configuration control 0: latched chip select lines: csx change 1 tcl after rising edge of ale 1: unlatched chip select lines: csx change with rising edge of ale. wrcfg write configuration control (inverted copy of bit wrc of rp0h) 0: pins wr and bhe retain their normal function 1: pin wr acts as wrl , pin bhe acts as wrh . clken system clock output enable (clkout) 0: clkout disabled: pin may be used for general purpose i/o 1: clkout enabled: pin outputs the system clock signal.
st10f280 150/186 table 37 : stack size selection buscon0 (ff0ch / 86h) sfr reset value: 0xx0h buscon1 (ff14h / 8ah) sfr reset value: 0000h buscon2 (ff16h / 8bh) sfr reset value: 0000h buscon3 (ff18h / 8ch) sfr reset value: 0000h bytdis disable/enable control for pin bhe (set according to data bus width) 0: pin bhe enabled 1: pin bhe disabled, pin may be used for general purpose i/o. romen internal memory enable (set according to pin ea during reset) 0: internal memory disabled: accesses to the memory area use the external bus 1: internal memory enabled. sgtdis segmentation disable/enable control 0: segmentation enabled (csp is saved/restored during interrupt entry/exit) 1: segmentation disabled (only ip is saved/restored). roms1 internal flash memory mapping 0: internal flash memory area mapped to segment 0 (000000h...007fffh) 1: internal flash memory area mapped to segment 1 (010000h...017fffh). stksz system stack size selects the size of the system stack (in the internal ram) from 32 to 1024 words. stack size (words) internal ram addresses (words) of physical stack significant bits of stack pointer sp 0 0 0 b 256 00fbfeh...00fa00h (default after reset) sp.8...sp.0 0 0 1 b 128 00fbfeh...00fb00h sp.7...sp.0 0 1 0 b 64 00fbfeh...00fb80h sp.6...sp.0 0 1 1 b 32 00fbfeh...00fbc0h sp.5...sp.0 1 0 0 b 512 00fbfeh...00f800h (not for 1k byte iram) sp.9...sp.0 1 0 1 b - reserved. do not use this combination - 1 1 0 b - reserved. do not use this combination - 1 1 1 b 1024 00fdfeh...00fx00h (note: no circular stack) 00fx00h represents the lower iram limit, i.e. 1k byte: 00fa00h, 2k byte: 00f600h, 3k byte: 00f200h sp.11...sp.0 15 14 13 12 11 10 9 876 5 4 3210 cswen0 csren0 rdypol0 rdyen0 - bus act0 ale ctl0 - btyp mttc0 rwdc0 mctc rw rw rw rw rw 2 rw 2 rw 1 rw rw rw 15 14 13 12 11 10 9 876 5 4 3210 cswen1 csren1 rdypol1 rdyen1 - busact1 alectl1 - btyp mttc1 rwdc1 mctc rw rw rw rw rw rw rw rw rw rw 15 14 13 12 11 10 9 876 5 4 3210 cswen2 csren2 rdypol2 rdyen2 - busact2 alectl2 - btyp mttc2 rwdc2 mctc rw rw rw rw rw rw rw rw rw rw 15 14 13 12 11 10 9 876 5 4 3210 cswen3 csren3 rdypol3 rdyen3 - busact3 alectl3 - btyp mttc3 rwdc3 mctc rw rw rw rw rw rw rw rw rw rw
st10f280 151/186 buscon4 (ff1ah / 8dh) sfr reset value: 0000h notes: 1. btyp (bit 6 and 7) are set according to the configuration of the bit l1 and l2 of port0 latched at the end of the rese t sequence. 2. buscon0 is initialized with 0000h, if ea pin is high during reset. if ea pin is low during reset, bit busact0 and alectrl0 are set (1) and bit field btyp is loaded with the bus configuration selected via port0. 15 14 13 12 11 10 9 876 5 4 3210 cswen4 csren4 rdypol4 rdyen4 - busact4 alectl4 - btyp mttc4 rwdc4 mctc rw rw rw rw rw rw rw rw rw rw mctc memory cycle time control (number of memory cycle time wait states) 0 0 0 0: 15 wait states (nber = 15 [mctc]) . . . 1 1 1 1: no wait states rwdcx read/write delay control for busconx 0: with read/write delay: activate command 1 tcl after falling edge of ale 1: no read/write delay: activate command with falling edge of ale mttcx memory tristate time control 0: 1 wait state 1: no wait state btyp external bus configuration 0 0: 8-bit demultiplexed bus 0 1: 8-bit multiplexed bus 1 0: 16-bit demultiplexed bus 1 1: 16-bit multiplexed bus note: for buscon0, btyp bit-field is defined via port0 during reset. alectlx ale lengthening control 0: normal ale signal 1: lengthened ale signal busactx bus active control 0: external bus disabled 1: external bus enabled (within the respective address window, see addrsel) rdyenx ready input enable 0: external bus cycle is controlled by bit field mctc only 1: external bus cycle is controlled by the ready input signal rdypolx ready active level control 0: active level on the ready pin is low, bus cycle terminates with a 0 on ready pin, 1: active level on the ready pin is high, bus cycle terminates with a 1 on ready pin. csrenx read chip select enable 0: the cs signal is independent of the read command (rd ) 1: the cs signal is generated for the duration of the read command cswenx write chip select enable 0: the cs signal is independent of the write command (wr ,wrl ,wrh ) 1: the cs signal is generated for the duration of the write command
st10f280 152/186 rp0h (f108h / 84h) esfr reset value: - - xxh notes: 1. rp0h.7 to rp0h.5 bits are loaded only during a long hardware reset. as pull-up resistors are active on each port p0h p ins during reset, rp0h default value is "ffh". 2. these bits are set according to port 0 configuration during any reset sequence. exicon ( f1c0h / e0h ) esfr reset value: 0000h 15 14 13 12 11 10 9 8 7 6 5 4 3 2 1 0 -------- clksel salsel cssel wrc r 1 - 2 r 2 r 2 r 2 wrc 2 write configuration control 0: pin wr acts as wrl , pin bhe acts as wrh 1: pins wr and bhe retain their normal function cssel 2 chip select line selection (number of active cs outputs) 0 0: 3 cs lines: cs 2...cs 0 0 1: 2 cs lines: cs 1...cs 0 1 0: no cs lines at all 1 1: 5 cs lines: cs 4...cs 0 (default without pull-downs) salsel 2 segment address line selection (number of active segment address outputs) 0 0: 4-bit segment address: a19...a16 0 1: no segment address lines at all 1 0: 8-bit segment address: a23...a16 1 1: 2-bit segment address: a17...a16 (default without pull-downs) clksel 1 - 2 system clock selection 000: f cpu = 2.5 x f osc 001: f cpu = 0.5 x f osc 010: f cpu = 10 x f osc 011: f cpu = f osc 100: f cpu = 5 x f osc 101: f cpu = 2 x f osc 110: f cpu = 3 x f osc 111: f cpu = 4 x f osc 1514131211109876543210 exi7es exi6es exi5es exi4es exi3es exi2es exi1es exi0es rw rw rw rw rw rw rw rw exixes(x=7...0) external interrupt x edge selection field (x=7...0) 0 0: fast external interrupts disabled: standard mode exxin pin not taken in account for entering/exiting power down mode. 0 1: interrupt on positive edge (rising) enter power down mode if exiin = 0, exit if exxin = 1 (referred as high active level) 1 0: interrupt on negative edge (falling) enter power down mode if exiin = 1, exit if exxin = 0 (referred as low active level) 1 1: interrupt on any edge (rising or falling) always enter power down mode, exit if exxin level changed.
st10f280 153/186 exisel (f1dah / edh) esfr reset value: 0000h xp3ic (f19eh / cfh) 1 esfr reset value: - - 00h note: 1. xp3ic register has the same bit field as xxic interrupt registers xxic (yyyyh / zzh) sfr area reset value: - - 00h 1514131211109876543210 exi7ss exi6ss exi5ss exi4ss exi3ss exi2ss exi1ss exi0ss rw rw rw rw rw rw rw rw exixss external interrupt x source selection (x=7...0) 00: input from associated port 2 pin. 01: input from alternate source. 10: input from port 2 pin ored with alternate source. 11: input from port 2 pin anded with alternate source. exixss port 2 pin alternate source 0 p2.8 can1_rxd 1 p2.9 can2_rxd 2...7 p2.10...15 not used (zero) 1514131211109876543210 - - - - - - - - xp3ir xp3ie xp3ilvl glvl rw rw rw rw 1514131211109876543210 -------- xxir xxie ilvl glvl rw rw rw rw bit function glvl group level defines the internal order for simultaneous requests of the same priority. 3: highest group priority 0: lowest group priority ilvl interrupt priority level defines the priority level for the arbitration of requests. fh: highest priority level 0h: lowest priority level xxie interrupt enable control bit (individually enables/disables a specific source) 0: interrupt request is disabled 1: interrupt request is enabled xxir interrupt request flag 0: no request pending 1: this source has raised an interrupt request
st10f280 154/186 xpercon (f024h / 12h) esfr reset value: - - 05h note: - when both can and xpwm are disabled via xpercon setting, then any access in the address range 00ec00h 00efffh will be directed to external memory interface, using the busconx register corresponding to address matching addrselx register. p4.4 and p4.7 can be used as general purpose i/o when can2 is not enabled, and p4.5 and p4.6 can be used as general purpose i/o when can1 is not enabled. - the default xper selection after reset is : xcan1 is enabled, xcan2 is disabled, xram is enabled, xport9, xtimer, xport10, xpwm are disabled. - register xpercon cannot be changed after the global enabling of xperipherals, i.e. after setting of bit xpen in syscon register. 15141312111098765 4 3 2 1 0 -----------xpwmenxperconen3xramencan2encan1en rw rw rw rw rw bit function can1en 0 1 can1 enable bit accesses to the on-chip can1 xperipheral and its functions are disabled. p4.5 and p4.6 pins can be used as general purpose i/os. address range 00ef00h-00efffh is only directed to external memory if can2en and xpwm bits are cleared also. the on-chip can1 xperipheral is enabled and can be accessed. can2en 0 1 can2 enable bit accesses to the on-chip can2 xperipheral and its functions are disabled. p4.4 and p4.7 pins can be used as general purpose i/os. address range 00ee00h-00eeffh is only directed to external memory if can1en and xpwm bits are cleared also. the on-chip can2 xperipheral is enabled and can be accessed. xramen 0 1 xram enable bit accesses to the on-chip 16k byte xram are disabled, external access performed. the on-chip 16k byte xram is enabled and can be accessed. xperconen3 0 1 xport9,xtimer, xport10, xadcmux enable bit accesses to the xport9, xtimer, xport10, xadcmux peripherals are disabled, external access performed. the on-chip xport9, xtimer, xport10, xadcmux peripherals are enabled and can be accessed. xpwmen 0 1 xpwm enable bit accesses to the on-chip xpwm are disabled, external access performed. address range 00ec00h-00ecffh is only directed to external memory if can1en and can2en are 0 also the on-chip xpwm is enabled and can be accessed.
st10f280 155/186 20 - electrical characteristics 20.1 - absolute maximum ratings note: 1. stresses above those listed under absolute maximum ratings may cause permanent damage to the device. this is a stress rating only and functional operation of the device at these or any other conditions above those indicated in the operational se ctions of this specification is not implied. exposure to absolute maximum rating conditions for extended periods may affect device rel iability. during overload conditions (v in > v dd or v in < v ss ) the voltage on pins with respect to ground (v ss ) must not exceed the values defined by the absolute maximum ratings. 20.2 - parameter interpretation the parameters listed in the following tables represent the characteristics of the st10f280 and its demands on the system. where the st10f280 logic provides signals with their respective timing characteristics, the symbol cc for controller characteristics, is included in the symbol column. where the external system must provide signals with their respective timing characteristics to the st10f280, the symbol sr for system requirement, is included in the symbol column. 20.3 - dc characteristics v dd = 5v 10%, v ss = 0v, f cpu = 40mhz, reset active, t a = -40 to +125c symbol parameter value unit v dd voltage on v dd pins with respect to ground 1 -0.5, +6.5 v v io voltage on any pin with respect to ground 1 -0.5, (v dd +0.5) v v aref voltage on v aref pin with respect to ground 1 -0.3, (v dd +0.3) v i ov input current on any pin during overload condition 1 -10, +10 ma i tov absolute sum of all input currents during overload condition 1 |100 ma| ma p tot power dissipation 1 1.5 w t a ambient temperature under bias -40, +125 c t stg storage temperature 1 -65, +150 c symbol parameter test conditions min. max. unit v il sr input low voltage C -0.5 0.2 v dd - 0.1 v v ils sr input low voltage (special threshold) C -0.5 2.0 v v ih sr input high voltage (all except rstin and xtal1) C 0.2 v dd + 0.9 v dd + 0.5 v v ih1 sr input high voltage rstin C 0.6 v dd v dd + 0.5 v v ih2 sr input high voltage xtal1 C 0.7 v dd v dd + 0.5 v v ihs sr input high voltage (special threshold) C 0.8 v dd - 0.2 v dd + 0.5 v hys input hysteresis (special threshold) 3 C 400 C mv v ol cc output low voltage (port0, port1, port 4, ale, rd , wr , bhe , clkout, rstout ) 1 i ol = 2.4ma C 0.45 v v ol1 cc output low voltage (all other outputs) 1 i ol1 = 1.6ma C 0.45 v
st10f280 156/186 notes: 1. st10f280 pins are equipped with low-noise output drivers which significantly improve the devices emi performance. the se low-noise drivers deliver their maximum current only until the respective target output level is reached. after this, the outpu t current is reduced. this results in increased impedance of the driver, which attenuates electrical noise from the connected pcb tracks. the current specified in column test conditions is delivered in any cases. 2. this specification is not valid for outputs which are switched to open drain mode. in this case the respective output will f loat and the voltage results from the external circuitry. 3. partially tested, guaranteed by design characterization. 4. overload conditions occur if the standard operating conditions are exceeded, i.e. the voltage on any pin exceeds the specifi ed range (i.e. v ov > v dd +0.5v or v ov <0.5v). the absolute sum of input overload currents on all port pins may not exceed 50ma. the supply voltage must remain within the specified limits. v oh cc output high voltage (port0, port1, port4, ale, rd , wr , bhe , clkout, rstout ) 1 i oh = -500 m a i oh = -2.4ma 0.9 v dd 2.4 C C v v oh1 cc output high voltage (all other outputs) 1/2 i oh = C 250 m a i oh = C 1.6ma 0.9 v dd 2.4 C C v v ? i oz1 ? cc input leakage current (port 5, xport 10) 0v < v in < v dd C 0.2 m a ? i oz2 ? cc input leakage current (all other) 0v < v in < v dd C1 m a ? i ov ? sr overload current 3/4 C5ma r rst cc rstin pull-up resistor 3 C 50 250 k w i rwh read / write inactive current 5/6 v out = 2.4v C -40 m a i rwl read / write active current 5/7 v out = v olmax -500 C m a i alel ale inactive current 5/6 v out = v olmax 40 C m a i aleh ale active current 5/7 v out = 2.4v C 500 m a i p6h port 6 inactive current 5/6 v out = 2.4v C -40 m a i p6l port 6 active current 5/7 v out = v ol1max -500 C m a i p0h port0 configuration current 5/6 v in = v ihmin C -10 m a i p0l 5/7 v in = v ilmax -100 C m a ? i il ? cc xtal1 input current 0v < v in < v dd C20 m a c io cc pin capacitance (digital inputs / outputs) 3/5 f = 1mhz, t a = 25c C10pf i cc power supply current 8 rstin = v ih1 f cpu in [mhz] C 30 + 3.3 x f cpu ma i id idle mode supply current 9 rstin = v ih1 f cpu in [mhz] C 20 + f cpu ma i pd power-down mode supply current 10 v dd = 5.5v t a = 55c C 200 m a symbol parameter test conditions min. max. unit
st10f280 157/186 5. this specification is only valid during reset, or during hold-mode or adapt-mode. port 6 pins are only affected if they are used for cs output and if their open drain function is not enabled. 6. the maximum current may be drawn while the respective signal line remains inactive. 7. the minimum current must be drawn in order to drive the respective signal line active. 8. the power supply current is a function of the operating frequency. this dependency is illustrated in the figure 74. these parameters are tested at v dd max and 40mhz cpu clock with all outputs disconnected and all inputs at vil or vih. the chip is configured with a demultiplexed 16-bit bus, direct clock drive, 5 chip select lines and 2 segment address lines, ea pin is low during reset. after reset, port 0 is driven with the value 00cch that produces infinite execution of nop instruction with 15 wait-sta te, r/ w delay, memory tristate wait state, normal ale. peripherals are not activated. 9. idle mode supply current is a function of the operating frequency. this dependency is illustrated in the figure 74. these parameters are tested at v dd max and 40mhz cpu clock with all outputs disconnected and all inputs at v il or v ih . 10. this parameter value includes leakage currents. with all inputs (including pins configured as inputs) at 0 v to 0.1v or at v dd C 0.1v to v dd , v ref = 0v, all outputs (including pins configured as outputs) disconnected. figure 74 : supply / idle current as a function of operating frequency i [ma] f cpu [mhz] 10 20 300 10 i cctyp i idmax i ccmax i idtyp 40 30 70ma 162ma
st10f280 158/186 20.3.1 - a/d converter characteristics v dd = 5v 10%, v ss = 0v , t a = -40 to +125c, 4.0v v aref v dd + 0.1v; v ss 0.1v v agnd v ss + 0.2v notes: 1. v ain may exceed v agnd or v aref up to the absolute maximum ratings. however, the conversion result in these cases will be x000h or x3ffh, respectively. 2. during the t s sample time the input capacitance c ain can be charged/discharged by the external source. the internal resistance of the analog source must allow the capacitance to reach its final voltage level within the t s sample time. after the end of the t s sample time, changes of the analog input voltage have no effect on the conversion result. values for the t sc sample clock depend on the programming. referring to the t c conversion time formula of section 20.3.2 and to the table 39 of page 156: - t s min = 2 t sc min = 2 t cc min = 2 x 24 x tcl = 48 tcl - t s max = 2 t sc max = 2 x 8 t cc max = 2 x 8 x 96 tcl = 1536 tcl tcl is defined in section 20.4.5 at page 159. 3. the conversion time formula is: - t c = 14 t cc + t s + 4 tcl (= 14 t cc + 2 t sc + 4 tcl) the t c parameter includes the t s sample time, the time for determining the digital result and the time to load the result register with the result of the conversion. values for the t cc conversion clock depend on the programming. referring to the table 39 of page 156: - t c min = 14 t cc min + t s min + 4 tcl = 14 x 24 x tcl + 48 tcl + 4 tcl = 388 tcl - t c max = 14 t cc max + t s max + 4 tcl = 14 x 96 tcl + 1536 tcl + 4 tcl = 2884 tcl 4. this parameter is fixed by adc control logic. 5. dnl, inl, tue are tested at v aref =5.0v, v agnd =0v, v cc = 4.9v. it is guaranteed by design characterization for all other voltages within the defined voltage range. lsb has a value of v aref / 1024. the specified tue is guaranteed only if an overload condition (see i ov specification) occurs on maximum 2 not selected analog input pins and the absolute sum of input overload currents on all analog input pins does not exceed 10ma. 6. the coupling factor is measured on a channel while an overload condition occurs on the adjacent not selected channel with an absolute overload current less than 10ma. 7. partially tested, guaranteed by design characterization. 8.to remove noise and undesirable high frequency components from the analog input signal, a low-pass filter must be connected a t the adc input. the cut-off frequency of this filter should avoid 2 opposite transitions during the t s sampling time of the st10 adc: - f cut-off 1 / 5 t s to 1/10 t s where t s is the sampling time of the st10 adc and is not related to the nyquist frequency determined by the t c conversion time. table 38 : a/d converter characteristics symbol parameter test condition limit values unit minimum maximum v aref sr analog reference voltage 4.0 v dd + 0.1 v v ain sr analog input voltage 1 - 8 v agnd v aref v i aref cc reference supply current running mode power-down mode 7 C C 500 1 m a m a c ain cc adc input capacitance not sampling sampling 7 C C 10 15 pf pf t s cc sample time 2 - 4 48 tcl 1 536 tcl t c cc conversion time 3 - 4 388 tcl 2 884 tcl dnl cc differential nonlinearity 5 -0.5 +0.5 lsb inl cc integral nonlinearity 5 -1.5 +1.5 lsb ofs cc offset error 5 -1.0 +1.0 lsb tue cc total unadjusted error 5 -2.0 +2.0 lsb r asrc sr internal resistance of analog source t s in [ns] 2 - 7 C(t s / 150) - 0.25 k w k cc coupling factor between inputs 6 - 7 C 1/500
st10f280 159/186 20.3.2 - conversion timing control when a conversion is started, first the capacitances of the converter are loaded via the respective analog input pin to the current analog input voltage. the time to load the capacitances is referred to as the sample time t s . next the sampled voltage is converted to a digital value in 10 successive steps, which correspond to the 10-bit resolution of the adc. the next 4 steps are used for equalizing internal levels (and are keep for exact timing matching with the 10-bit a/d converter module implemented in st10f168). the current that has to be drawn from the sources for sampling and changing charges depends on the time that each respective step takes, because the capacitors must reach their final voltage level within the given time, at least with a certain approximation. the maximum current, however, that a source can deliver, depends on its internal resistance. the sample time t s (= 2 t sc ) and the conversion time t c (= 14 t cc + 2 t sc + 4 tcl) can be programmed relatively to the st10f280 cpu clock. this allows adjusting the a/d converter of the st10f280 to the properties of the system: fast conversion can be achieved by programming the respective times to their absolute possible minimum. this is preferable for scanning high frequency signals. the internal resistance of analog source and analog supply must be sufficiently low, however. high internal resistance can be achieved by programming the respective times to a higher value, or the possible maximum. this is preferable when using analog sources and supply with a high internal resistance in order to keep the current as low as possible. however, the conversion rate in this case may be considerably lower. the conversion times are programmed via the upper four bit of register adcon. bit field adctc (conversion time control) selects the basic conversion clock t cc , used for the 14 steps of converting. the sample time t s is a multiple of this conversion time and is selected by bit field adstc (sample time control). the table below lists the possible combinations. the timings refer to the unit tcl, where f cpu = 1/2 tcl. a complete conversion will take 14 t cc + 2 t sc + 4 tcl (fastest convertion rate = 4.85 m s at 40mhz). this time includes the conversion itself, the sample time and the time required to transfer the digital value to the result register. table 39 : adc sampling and conversion timing adctc conversion clock t cc adstc sample clock t sc tcl = 1/2 x f xtal at f cpu = 40mhz t sc = at f cpu = 40mhz and adctc = 00 00 tcl x 24 0.3 m s00 t cc 0.3 m s 01 reserved, do not use reserved 01 t cc x 2 0.6 m s 10 tcl x 96 1.2 m s10t cc x 4 1.2 m s 11 tcl x 48 0.6 m s11t cc x 8 2.4 m s
st10f280 160/186 20.4 - ac characteristics 20.4.1 - test waveforms 20.4.2 - definition of internal timing the internal operation of the st10f280 is controlled by the internal cpu clock f cpu . both edges of the cpu clock can trigger internal (for example pipeline) or external (for example bus cycles) operations. the specification of the external timing (ac characteristics) therefore depends on the time between two consecutive edges of the cpu clock, called tcl. the cpu clock signal can be generated by different mechanisms. the duration of tcl and its variation (and also the derived external timing) depends on the mechanism used to generate f cpu . this influence must be regarded when calculating the timings for the st10f280. the example for pll operation shown in figure 77 refers to a pll factor of 4. figure 75 : input / output waveforms figure 76 : float waveforms 2.4v 0.45v test points 0.2v dd +0.9 0.2v dd +0.9 0.2v dd -0.1 0.2v dd -0.1 a c inputs during testing are driven at 2.4v for a logic 1 and 0.4v for a logic 0. t iming measurements are made at v ih min for a logic 1 and v il max for a logic 0. timing reference points v load +0.1v v load -0.1v v oh -0.1v v ol +0.1v v load v ol v oh for timing purposes a port pin is no longer floating when v load changes of 100mv. it begins to float when a 100mv change from the loaded v oh /v ol level occurs (i oh /i ol = 20ma).
st10f280 161/186 the mechanism used to generate the cpu clock is selected during reset by the logic levels on pins p0.15-13 (p0h.7-5). 20.4.3 - clock generation modes the table 40 associates the combinations of these three bit with the respective clock generation mode. notes: 1. the external clock input range refers to a cpu clock range of 1...40mhz. 2. the maximum depends on the duty cycle of the external clock signal. 3. the maximum input frequency is 25mhz when using an external crystal with the internal oscillator; providing that internal se rial resistance of the crystal is less than 40 w . however, higher frequencies can be applied with an external clock source on pin xtal1, but in this case, the input clock signal must reach the defined levels v il and v ih2. . 4. the pll free-running frequency is from 2 to 10mhz. figure 77 : generation mechanisms for the cpu clock table 40 : cpu frequency generation p0h.7 p0h.6 p0h.5 cpu frequency f cpu = f xtal x f external clock input range 1 notes 111 f xtal x 4 2.5 to 10mhz default configuration 110 f xtal x 3 3.33 to 13.33mhz 101 f xtal x 2 5 to 20mhz 100 f xtal x 5 2 to 8mhz 011 f xtal x 1 1 to 40mhz direct drive 2 4 010 f xtal x 10 1 to 4mhz 001 f xtal x 0.5 2 to 80mhz cpu clock via prescaler 3 000 f xtal x 2.5 4 to 16mhz tcl tcl f cpu f xtal f cpu f xtal phase locked loop operation direct clock drive tcl tcl f cpu f xtal prescaler operation tcl tcl
st10f280 162/186 20.4.4 - prescaler operation when pins p0.15-13 (p0h.7-5) equal 001 during reset, the cpu clock is derived from the internal oscillator (input clock signal) by a 2:1 prescaler. the frequency of f cpu is half the frequency of f xtal and the high and low time of f cpu (i.e. the duration of an individual tcl) is defined by the period of the input clock f xtal . the timings listed in the ac characteristics that refer to tcl therefore can be calculated using the period of f xtal for any tcl. note that if the bit owddis in syscon register is cleared, the pll runs on its free-running frequency and delivers the clock signal for the oscillator watchdog. if bit owddis is set, then the pll is switched off. 20.4.5 - direct drive when pins p0.15-13 (p0h.7-5) equal 011 during reset the on-chip phase locked loop is disabled and the cpu clock is directly driven from the internal oscillator with the input clock signal. the frequency of f cpu directly follows the frequency of f xtal so the high and low time of f cpu (i.e. the duration of an individual tcl) is defined by the duty cycle of the input clock f xtal . therefor, the timings given in this chapter refer to the minimum tcl. this minimum value can be calculated by the following formula: for two consecutive tcls, the deviation caused by the duty cycle of f xtal is compensated, so the duration of 2 tcl is always 1/f xtal . the minimum value tcl min has to be used only once for timings that require an odd number of tcls (1,3,...). timings that require an even number of tcls (2,4,...) may use the formula: note: the address float timings in multiplexed bus mode (t 11 and t 45 ) use the maximum duration of tcl (tcl max = 1/f xtal x dc max ) instead of tcl min . if the bit owddis in syscon register is cleared, the pll runs on its free-running frequency and delivers the clock signal for the oscillator watchdog. if bit owddis is set, then the pll is switched off. 20.4.6 - oscillator watchdog (owd) an on-chip watchdog oscillator is implemented in the st10f280. this feature is used for safety operation with external crystal oscillator (using direct drive mode with or without prescaler). this watchdog oscillator operates as following : the reset default configuration enables the watchdog oscillator. it can be disabled by setting the owddis (bit 4) of syscon register. when the owd is enabled, the pll runs at its free-running frequency, and it increments the watchdog counter. the pll free-running frequency is from 2 to 10mhz. on each transition of external clock, the watchdog counter is cleared. if an external clock failure occurs, then the watchdog counter overflows (after 16 pll clock cycles). the cpu clock signal will be switched to the pll free-running clock signal, and the oscillator watchdog interrupt request (xp3int) is flagged. the cpu clock will not switch back to the external clock even if a valid external clock exits on xtal1 pin. only a hardware reset can switch the cpu clock source back to direct clock input. when the owd is disabled, the cpu clock is always external oscillator clock and the pll is switched off to decrease consumption supply current. 20.4.7 - phase locked loop for all other combinations of pins p0.15-13 (p0h.7-5) during reset the on-chip phase locked loop is enabled and it provides the cpu clock (see table 40). the pll multiplies the input frequency by the factor f which is selected via the combination of pins p0.15-13 (f cpu = f xtal x f). with every fth transition of f xtal the pll circuit synchronizes the cpu clock to the input clock. this synchronization is done smoothly, so the cpu clock frequency does not change abruptly. due to this adaptation to the input clock the frequency of f cpu is constantly adjusted so it is locked to f xtal . the slight variation causes a jitter of f cpu which also effects the duration of individual tcls. the timings listed in the ac characteristics that refer to tcls therefore must be calculated using the minimum tcl that is possible under the respective circumstances. tcl min 1f xt al l x l dc min = dc duty cycle = 2tcl 1 f xtal =
st10f280 163/186 the real minimum value for tcl depends on the jitter of the pll. the pll tunes f cpu to keep it locked on f xtal . the relative deviation of tcl is the maximum when it is refered to one tcl period. it decreases according to the formula and to the figure 78 given below. for n periods of tcl the minimum value is computed using the corresponding deviation d n : where n = number of consecutive tcl periods and 1 n 40. so for a period of 3 tcl periods (n = 3): d 3 = 4 - 3/15 = 3.8% 3tcl min =3 tcl nom x (1 - 3.8/100) =3 tcl nom x 0.962 3tcl min = (36.075ns at f cpu = 40mhz) this is especially important for bus cycles using wait states and e.g. for the operation of timers, serial interfaces, etc. for all slower operations and longer periods (e.g. pulse train generation or measurement, lower baud rates, etc.) the deviation caused by the pll jitter is negligible. 20.4.8 - external clock drive xtal1 v dd = 5v 10%, v ss = 0v, t a = -40 to +125 c notes: 1. theoretical minimum. the real minimum value depends on the duty cycle of the input clock signal. 25mhz is the maximum input frequency when using an external crystal oscillator. howevwer, 40mhz can be applied with an external clock source. 2. the input clock signal must reach the defined levels v il and v ih2 . tcl min tcl nom 1 d n 100 ------------- C ?? ?? ?? ?? = d n 4n15 ) % [] C ( = figure 78 : approximated maximum pll jitter parameter symbol f cpu = f xtal f cpu = f xtal / 2 f cpu = f xtal x f f = 2 / 2.5 / 3 / 4 / 5 / 10 unit min max min max min max oscillator period t osc sr 25 1 C 12.5 C 40 x n 100 x n ns high time t 1 sr 10 2 C 5 2 C 10 2 Cns low time t 2 sr 10 2 C 5 2 C 10 2 Cns rise time t 3 sr C 3 2 C 3 3 C 3 2 ns fall time t 4 sr C 3 2 C 3 2 C 3 2 ns 32 16 8 4 2 1 2 3 4 max.jitter [%] n this approximated formula is valid for 1 n 40 and 10mhz f cpu 40mhz.
st10f280 164/186 figure 79 : external clock drive xtal1 20.4.9 - memory cycle variables the tables below use three variables which are derived from the busconx registers and represent the special characteristics of the programmed memory cycle. the following table describes, how these variables are to be computed. description symbol values ale extension t a tcl x [alectl] memory cycle time wait states t c 2 tcl x (15 - [mctc]) memory tri-state time t f 2 tcl x (1 - [mttc]) t 1 t 3 t 4 v ih2 t 2 t osc v il
st10f280 165/186 20.4.10 - multiplexed bus v dd = 5v 10%, v ss = 0v, t a = -40 to +125c, c l = 50pf, ale cycle time = 6 tcl + 2t a + t c + t f (75ns at 40mhz cpu clock without wait states). table 41 : multiplexed bus characteristics symbol parameter max. cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max. t 5 cc ale high time 4 + t a C tcl - 8.5 + t a Cns t 6 cc address setup to ale 2 + t a C tcl - 10.5 + t a Cns t 7 cc address hold after ale 1 4 + t a C tcl - 8.5 + t a Cns t 8 cc ale falling edge to rd , wr (with rw-delay) 4 + t a C tcl - 8.5 + t a Cns t 9 cc ale falling edge to rd , wr (no rw-delay) -8.5 + t a C -8.5 + t a Cns t 10 cc address float after rd , wr (with rw-delay) 1 C6 C 6ns t 11 cc address float after rd , wr (no rw-delay) 1 C 18.5 C tcl + 6 ns t 12 cc rd , wr low time (with rw-delay) 15.5 + t c C 2 tcl -9.5 + t c Cns t 13 cc rd , wr low time (no rw-delay) 28 + t c C 3 tcl -9.5 + t c Cns t 14 sr rd to valid data in (with rw-delay) C6 + t c C 2 tcl - 19 + t c ns t 15 sr rd to valid data in (no rw-delay) C 18.5 + t c C 3 tcl - 19 + t c ns t 16 sr ale low to valid data in C 18.5 + t a + t c C 3 tcl - 19 + t a + t c ns t 17 sr address/unlatched cs to valid data in C 22 + 2t a + t c C 4 tcl - 28 + 2t a + t c ns t 18 sr data hold after rd rising edge 0C 0 Cns t 19 sr data float after rd 1 C 16.5 + t f C 2 tcl - 8.5 + t f ns t 22 cc data valid to wr 10 + t c C 2 tcl -15 + t c Cns t 23 cc data hold after wr 4 + t f C 2 tcl - 8.5 + t f Cns t 25 cc ale rising edge after rd , wr 15 + t f C 2 tcl -10 + t f Cns t 27 cc address/unlatched cs hold after rd , wr 10 + t f C 2 tcl -15 + t f Cns t 38 cc ale falling edge to latched cs -4 - t a 10 - t a -4 - t a 10 - t a ns t 39 sr latched cs low to valid data in C 18.5 + t c + 2t a C 3 tcl - 19 + t c + 2t a ns t 40 cc latched cs hold after rd , wr 27 + t f C 3 tcl - 10.5 + t f Cns
st10f280 166/186 note: 1. partially tested, guaranted by design characterization. t 42 cc ale fall. edge to rdcs , wrcs (with rw delay) 7 + t a C tcl - 5.5+ t a Cns t 43 cc ale fall. edge to rdcs , wrcs (no rw delay) -5.5 + t a C -5.5 + t a Cns t 44 cc address float after rdcs , wrcs (with rw delay) 1 C0 C 0ns t 45 cc address float after rdcs , wrcs (no rw delay) 1 C 12.5 C tcl ns t 46 sr rdcs to valid data in (with rw delay) C4 + t c C 2 tcl - 21 + t c ns t 47 sr rdcs to valid data in (no rw delay) C 16.5 + t c C 3 tcl - 21 + t c ns t 48 cc rdcs , wrcs low time (with rw delay) 15.5 + t c C 2 tcl - 9.5 + t c Cns t 49 cc rdcs , wrcs low time (no rw delay) 28 + t c C 3 tcl - 9.5 + t c Cns t 50 cc data valid to wrcs 10 + t c C 2 tcl - 15+ t c Cns t 51 sr data hold after rdcs 0C 0 Cns t 52 sr data float after rdcs 1 C 16.5 + t f C 2 tcl - 8.5+t f ns t 54 cc address hold after rdcs , wrcs 6 + t f C 2 tcl - 19 + t f Cns t 56 cc data hold after wrcs 6 + t f C 2 tcl - 19 + t f Cns table 41 : multiplexed bus characteristics symbol parameter max. cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit min. max. min. max.
st10f280 167/186 figure 80 : external memory cycle : multiplexed bus, with / without read / write delay, normal ale data in data out address address t 38 t 10 read cycle write cycle t 5 t 16 t 39 t 40 t 25 t 27 t 18 t 14 t 22 t 23 t 12 t 8 t 8 t 6m t 19 address t 17 t 6 t 7 t 9 t 11 t 13 t 15 t 16 t 12 t 13 address t 9 t 17 t 6 t 27 clkout ale csx a23-a16 (a15-a8) address/data rd wr wrl bhe wrh bus (p0) address/data bus (p0)
st10f280 168/186 figure 81 : external memory cycle: multiplexed mus, with / without read / write delay, extended ale data out address data in address address t 5 t 16 t 6 t 7 t 39 t 40 t 14 t 8 t 18 t 23 t 6 t 27 t 38 t 10 t 19 t 25 t 17 t 9 t 11 t 15 t 12 t 13 t 8 t 10 t 9 t 11 t 12 t 13 t 22 t 27 t 17 t 6 read cycle write cycle clkout ale csx a23-a16 (a15-a8) rd wr wrl bhe wrh address/data bus (p0) address/data bus (p0)
st10f280 169/186 figure 82 : external memory cycle: multiplexed bus, with / without read / write delay, normal ale, read / write chip select read cycle write cycle clkout ale a23-a16 (a15-a8) bhe data in data out address address t 44 t 5 t 16 t 25 t 27 t 51 t 46 t 50 t 56 t 48 t 42 t 42 t 6 t 52 address t 17 t 6 t 7 t 43 t 45 t 49 t 47 t 16 t 48 t 49 address t 43 rdcsx wrcsx address/data bus (p0) address/data bus (p0)
st10f280 170/186 figure 83 : external memory cycle: multiplexed bus, with / without read / write delay, extended ale, read / write chip select data out address data in address address t 5 t 16 t 6 t 7 t 46 t 42 t 42 t 50 t 18 t 56 t 6 t 54 t 44 t 19 t 25 t 17 t 43 t 45 t 47 t 48 t 49 t 49 t 43 t 48 t 44 t 45 read cycle write cycle clkout ale a23-a16 (a15-a8) bhe rdcsx wrcsx address/data bus (p0) address/data bus (p0)
st10f280 171/186 20.4.11 - demultiplexed bus v dd = 5v 10%, v ss = 0v, t a = -40 to +125c, c l = 50pf, ale cycle time = 4 tcl + 2t a + t c + t f (50ns at 40mhz cpu clock without wait states). table 42 : demultiplexed bus characteristics symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit minimum maximum minimum maximum t 5 cc ale high time 4 + t a C tcl - 8.5 + t a Cns t 6 cc address setup to ale 2 + t a C tcl - 10.5 + t a Cns t 80 cc address/unlatched cs setup to rd , wr (with rw-delay) 16.5 + 2t a C 2 tcl - 8.5 + 2t a Cns t 81 cc address/unlatched cs setup to rd , wr (no rw-delay) 4 + 2t a C tcl - 8.5 + 2t a Cns t 12 cc rd , wr low time (with rw-delay) 15.5 + t c C 2 tcl - 9.5 + t c Cns t 13 cc rd , wr low time (no rw-delay) 28 + t c C 3 tcl - 9.5 + t c Cns t 14 sr rd to valid data in (with rw-delay) C6 + t c C 2 tcl - 19 + t c ns t 15 sr rd to valid data in (no rw-delay) C 18.5 + t c C 3 tcl - 19 + t c ns t 16 sr ale low to valid data in C 18.5 + t a + t c C 3 tcl - 19 + t a + t c ns t 17 sr address/unlatched cs to valid data in C22 + 2t a + t c C 4 tcl - 28 + 2t a + t c ns t 18 sr data hold after rd rising edge 0C 0 Cns t 20 sr data float after rd rising edge (with rw-delay) 1 3 C 16.5 + t f C 2 tcl - 8.5 + t f + 2t a 1 ns t 21 sr data float after rd rising edge (no rw-delay) 1 3 C4 + t f C tcl - 8.5 + t f + 2t a 1 ns t 22 cc data valid to wr 10 + t c C 2 tcl - 15 + t c Cns t 24 cc data hold after wr 4 + t f C tcl - 8.5 + t f Cns t 26 cc ale rising edge after rd , wr -10 + t f C -10 + t f Cns t 28 cc address/unlatched cs hold after rd , wr 2 0 (no t f ) -5 + t f (t f > 0) C 0 (no t f ) -5 + t f (t f > 0) Cns t 28h cc address/unlatched cs hold after wrh -5 + t f C -5 + t f Cns t 38 cc ale falling edge to latched cs -4 - t a 6 - t a -4 - t a 6 - t a ns t 39 sr latched cs low to valid data in C 18.5 + t c + 2t a C 3 tcl - 19 + t c + 2t a ns
st10f280 172/186 notes: 1. rw-delay and t a refer to the next following bus cycle. 2. read data are latched with the same clock edge that triggers the address change and the rising rd edge. therefore address changes before the end of rd have no impact on read cycles. 3. partially tested, guaranteed by design characterization. t 41 cc latched cs hold after rd , wr 2 + t f C tcl - 10.5 + t f Cns t 82 cc address setup to rdcs , wrcs (with rw-delay) 14.5 + 2t a C 2 tcl - 10.5 + 2t a Cns t 83 cc address setup to rdcs , wrcs (no rw-delay) 2 + 2t a C tcl - 10.5 + 2t a Cns t 46 sr rdcs to valid data in (with rw-delay) C4 + t c C 2 tcl - 21 + t c ns t 47 sr rdcs to valid data in (no rw-delay) C 16.5 + t c C 3 tcl - 21 + t c ns t 48 cc rdcs , wrcs low time (with rw-delay) 15.5 + t c C 2 tcl - 9.5 + t c Cns t 49 cc rdcs , wrcs low time (no rw-delay) 28 + t c C 3 tcl - 9.5 + t c Cns t 50 cc data valid to wrcs 10 + t c C 2 tcl - 15 + t c Cns t 51 sr data hold after rdcs 0C 0 Cns t 53 sr data float after rdcs (with rw-delay) 3 C 16.5 + t f C 2 tcl - 8.5 + t f ns t 68 sr data float after rdcs (no rw-delay) 3 C4 + t f C tcl - 8.5 + t f ns t 55 cc address hold after rdcs , wrcs -8.5 + t f C -8.5 + t f Cns t 57 cc data hold after wrcs 2 + t f C tcl - 10.5 + t f Cns table 42 : demultiplexed bus characteristics symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit minimum maximum minimum maximum
st10f280 173/186 figure 84 : external memory cycle: demultiplexed bus, with / without read / write delay, normal ale note: 1. un-latched csx = t 41u = t 41 tcl =10.5 + t f . write cycle clkout ale a23-a16 a15-a0 (p1) bhe wr wrl wrh data in data out t 38 t 5 t 16 t 39 t 41 t 18 t 14 t 22 t 12 address t 17 t 13 t 15 t 12 t 13 t 21 t 20 t 81 t 80 t 26 t 24 t 17 t 6 t 41u t 6 t 80 t 81 t 28 (or t 28h ) csx read cycle data bus (p0) rd 1) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0
st10f280 174/186 figure 85 : external memory cycle: demultiplexed bus, with / without read / write delay, extended ale address t 5 t 16 t 39 t 41 t 14 t 24 t 6 t 38 t 20 t 26 t 17 t 15 t 12 t 13 t 12 t 13 t 22 data in t 18 t 21 t 6 t 17 t 28 t 28 data out t 80 t 81 t 80 t 81 read cycle write cycle clkout ale csx rd wr wrl wrh data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe
st10f280 175/186 figure 86 : external memory cycle: demultiplexed bus, with / without read / write delay, normal ale, read / write chip select read cycle write cycle clkout ale data in data out t 5 t 16 t 51 t 46 t 50 t 48 address t 17 t 49 t 47 t 48 t 49 t 68 t 53 t 83 t 82 t 26 t 57 t 55 t 6 t 82 t 83 rdcsx wrcsx data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe
st10f280 176/186 figure 87 : external memory cycle: demultiplexed bus, no read / write delay, extended ale, read / write chip select address t 5 t 16 t 46 t 57 t 6 t 53 t 26 t 17 t 47 t 48 t 49 t 48 t 49 t 50 data in t 51 t 68 t 55 data out t 82 t 83 t 82 t 83 read cycle write cycle clkout ale rdcsx wrcsx data bus (p0) (d15-d8) d7-d0 data bus (p0) (d15-d8) d7-d0 a23-a16 a15-a0 (p1) bhe
st10f280 177/186 20.4.12 - clkout and ready v dd = 5v 10%, v ss = 0v, t a = -40 to +125c, c l = 50pf notes: 1. these timings are given for test purposes only, in order to assure recognition at a specific clock edge. 2. demultiplexed bus is the worst case. for multiplexed bus 2 tcl are to be added to the maximum values. this adds even more time for deactivating ready. the 2t a and t c refer to the next following bus cycle, t f refers to the current bus cycle. table 43 : clkout and ready characteristics symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit minimum maximum minimum maximum t 29 cc clkout cycle time 25 25 2 tcl 2tcl ns t 30 cc clkout high time 4 C tcl C 8.5 C ns t 31 cc clkout low time 3 C tcl C 9.5 C ns t 32 cc clkout rise time C 4 C 4 ns t 33 cc clkout fall time C 4 C 4 ns t 34 cc clkout rising edge to ale falling edge -2 + t a 8 + t a -2 + t a 8 + t a ns t 35 sr synchronous ready setup time to clkout 12.5 C 12.5 C ns t 36 sr synchronous ready hold time after clkout 2C 2 Cns t 37 sr asynchronous ready low time 35 C 2 tcl + 10 C ns t 58 sr asynchronous ready setup time 1) 12.5 C 12.5 C ns t 59 sr asynchronous ready hold time 1) 2C 2 Cns t 60 sr async. ready hold time after rd , wr high (demultiplexed bus) 2) 0 0 + 2t a + t c + t f 2) 0 tcl - 12.5 + 2t a + t c + t f 2) ns
st10f280 178/186 figure 88 : clkout and ready notes: 1. cycle as programmed, including mctc wait states (example shows 0 mctc ws). 2. the leading edge of the respective command depends on rw-delay. 3. ready sampled high at this sampling point generates a ready controlled wait state, ready sampled low at this sampling point terminates the currently running bus cycle. 4. ready may be deactivated in response to the trailing (rising) edge of the corresponding command (rd or wr ). 5. if the asynchronous ready signal does not fulfill the indicated setup and hold times with respect to clkout (e.g. because clkout is not enabled), it must fulf ill t 37 in order to be safely synchronized. this is guaranteed, if ready is removed in response to the command (see note 4)). 6. multiplexed bus modes have a mux wait state added after a bus cycle, and an additional mttc wait state may be inserted here. for a multiplexed bus with mttc wait state this delay is 2 clkout cycles, for a demultiplexed bus without mttc wait state this delay is zero. 7. the next external bus cycle may start here. t 30 t 34 t 35 t 36 t 35 t 36 t 58 t 59 t 58 t 59 wait state ready mux / tri-state 6) t 32 t 33 t 29 running cycle 1) t 31 t 37 3) 3) 5) t 60 4) 6) 2) 7) 3) 3) clkout ale rd , wr synchronous asynchronous ready ready
st10f280 179/186 20.4.13 - external bus arbitration v dd = 5v 10%, v ss = 0v, t a = -40 to +125c, c l = 50pf note: 1. partially tested, guaranteed by design characterization. notes: 1. the st10f280 will complete the currently running bus cycle before granting bus access. 2. this is the first possibility for breq to become active. 3. the cs outputs will be resistive high (pull-up) after t 64 . symbol parameter maximum cpu clock = 40mhz variable cpu clock 1/2 tcl = 1 to 40mhz unit minimum maximum minimum maximum t 61 sr hold input setup time to clkout 15 C 15 C ns t 62 cc clkout to hlda high or breq low delay C 12.5 C 12.5 ns t 63 cc clkout to hlda low or breq high delay C 12.5 C 12.5 ns t 64 cc csx release 1 C 15 C 15 ns t 65 cc csx drive -4 15 -4 15 ns t 66 cc other signals release 1 C 15 C 15 ns t 67 cc other signals drive -4 15 -4 15 ns figure 89 : external bus arbitration, releasing the bus t 61 t 63 t 66 1) t 64 1) 2) t 62 3) clkout hold hlda breq others csx (p6.x)
st10f280 180/186 figure 90 : external bus arbitration, (regaining the bus) notes: 1. this is the last chance for breq to trigger the indicated regain-sequence. even if breq is activated earlier, the regain-sequence is initiated by hold going high. please note that hold may also be disactivated without the st10f280 requesting the bus. 2. the next st10f280 driven bus cycle may start here. clkout hold hlda other signals t 62 csx (on p6.x) t 67 t 62 1) 2) t 65 t 61 breq t 63 t 62
st10f280 181/186 20.4.14 - high-speed synchronous serial interface (ssc) timing 20.4.14.1 master mode v cc = 5v 10%, v ss = 0v, cpu clock = 40mhz, t a = -40 to +125c, c l = 50pf note: 1. timing guaranteed by design. the formula for ssc clock cycle time is : t 300 = 4 tcl * ( + 1) where represents the content of the ssc baud rate register, taken as unsigned 16-bit integer. notes: 1. the phase and polarity of shift and latch edge of sclk is programmable. this figure uses the leading clock edge as shi ft edge (drawn in bold), with latch on trailing edge (sscph = 0b), idle clock line is low, leading clock edge is low-to-high transition (sscpo = 0b). 2. the bit timing is repeated for all bits to be transmitted or received. symbol parameter maximum baud rate = 10m baud ( = 0001h) variable baud rate (=0001h-ffffh) unit minimum maximum minimum maximum t 300 cc ssc clock cycle time 100 100 8 tcl 262144 tcl ns t 301 cc ssc clock high time 40 C t 300 /2 - 10 Cns t 302 cc ssc clock low time 40 C t 300 /2 - 10 Cns t 303 cc ssc clock rise time C 10 C 10 ns t 304 cc ssc clock fall time C 10 C 10 ns t 305 cc write data valid after shift edge C 15 C 15 ns t 306 cc write data hold after shift edge 1 -2 C -2 C ns t 307p sr read data setup time before latch edge, phase error detection on (sscpen = 1) 37.5 C 2 tcl + 12.5 C ns t 308p sr read data hold time after latch edge, phase error detection on (sscpen = 1) 50 C 4 tcl C ns t 307 sr read data setup time before latch edge, phase error detection off (sscpen = 0) 25 C 2 tcl C ns t 308 sr read data hold time after latch edge, phase error detection off (sscpen = 0) 0C0Cns figure 91 : ssc master timing t 303 t 304 t 305 t 305 t 305 t 306 1st out bit last out bit 2nd out bit t 300 t 302 t 301 1) 2) t 307 2nd.in bit 1st.in bit t 308 t 307 last.in bit t 308 sclk mtsr mrst
st10f280 182/186 20.4.14.2 slave mode v cc = 5v 10%, v ss = 0v, cpu clock = 40mhz, t a = -40 to +125c, c l = 50pf the formula for ssc clock cycle time is: t 310 = 4 tcl * ( + 1) where represents the content of the ssc baud rate register, taken as unsigned 16-bit integer. notes: 1. the phase and polarity of shift and latch edge of sclk is programmable. this figure uses the leading clock edge as shi ft edge (drawn in bold), with latch on trailing edge (sscph = 0b), idle clock line is low, leading clock edge is low-to-high transition (sscpo = 0b). 2. the bit timing is repeated for all bits to be transmitted or received. symbol parameter maximum baud rate=10mbd ( = 0001h) variable baud rate (=0001h-ffffh) unit minimum maximum minimum maximum t 310 sr ssc clock cycle time 100 100 8 tcl 262144 tcl ns t 311 sr ssc clock high time 40 C t 310 /2 - 10 Cns t 312 sr ssc clock low time 40 C t 310 /2 - 10 Cns t 313 sr ssc clock rise time C 10 C 10 ns t 314 sr ssc clock fall time C 10 C 10 ns t 315 cc write data valid after shift edge C 39 C 2 tcl + 14 ns t 316 cc write data hold after shift edge 0 C 0 C ns t 317p sr read data setup time before latch edge, phase error detection on (sscpen = 1) 62 C 4 tcl + 12 C ns t 318p 1 sr read data hold time after latch edge, phase error detection on (sscpen = 1) 87 C 6 tcl + 12 C ns t 317 sr read data setup time before latch edge, phase error detection off (sscpen = 0) 6C6Cns t 318 sr read data hold time after latch edge, phase error detection off (sscpen = 0) 31 C 2 tcl + 6 C ns figure 92 : ssc slave timing t 313 t 314 t 315 t 315 t 315 t 316 1st out bit last out bit 2nd out bit t 310 t 312 t 311 1) 2) t 317 2nd.in bit 1st.in bit t 318 t 317 last.in bit t 318 sclk mrst mtsr
st10f280 183/186 21 - package mechanical data figure 93 : package outline pbga 208 (23 x 23 x 1.96 mm) dimensions millimeters inches (approx) minimum typical maximum minimum typical maximum a 1.960 0.077 a1 0.500 0.600 0.700 0.019 0.024 0.028 a2 1.360 0.054 a3 0.560 0.022 f b 0.600 0.760 0.900 0.024 0.030 0.035 d 22.900 23.000 23.100 0.902 0.906 0.909 d1 20.320 0.800 e 22.900 23.000 23.100 0.902 0.906 0.909 e1 20.320 0.800 e 1.270 0.50 f 1.240 1.340 1.440 0.049 0.053 0.057 aaa 0.150 0.006 a1 e1 f b (208 + 25 balls) u t r p n m l k 10 11 12 13 14 15 16 17 000 6789 j g f h e d b a c 45 123 a1 ball pad corner 2 f e e e d1 d f a2 a3 c seating plane a c
st10f280 184/186 notes: 1. pbga stands for plastic ball grid array. 2. the terminal a1 corner must be identified on the top surface of the package by using a corner chamfer, ink or metalized markings, identation or other feature of package body or integral heastslug. a distinguishing feature is allowable on the bottom of the package to identify the terminal a1 corner. exact shape and size of this feature is optional. 22 - ordering information salestype temperature range package st10f280-jt3 -40c to +125c pbga 208 (23 x 23 x 1.96 mm)
st10f280 185/186
186/186 st10f280 information furnished is believed to be accurate and reliable. however, stmicroelectronics assumes no responsibility for the consequences of use of such information nor for any infringement of patents or other rights of third parties which may result f rom its use. no license is granted by implication or otherwise under any patent or patent rights of stmicroelectronics. specificati ons mentioned in this publication are subject to change without notice. this publication supersedes and replaces all information previously supplied. stmicroelectronics products are not authorized for use as critical components in life support devices or systems without express written approval of stmicroelectronics. the st logo is a registered trademark of stmicroelectronics ? 2003 stmicroelectronics all rights reserved stmicroelectronics group of companies australia - brazil - canada - china - finland - france - germany - hong kong - india - israel - italy - japan - malaysia - malt a - morocco singapore - spain - sweden - switzerland - united kingdom - united states http://www.st.com st10f280.ref


▲Up To Search▲   

 
Price & Availability of ST10F280-Q3TR

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X